Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Cannot resolve the collation conflict between

Author  Topic 

RMH1972
Starting Member

11 Posts

Posted - 2010-08-17 : 08:56:11
Hello,

I have a problem with an "insert into" and a collation conflict.
I created a T-sql script
>>>
use marval_Produktie
insert into dbo.CONTACT_DIVISION
([Name], Descrip, Fulong, SLA)
(select costcenter, definition, 0, costcenter
from server2.INT_COMMON.dbo.kpl
where parent = 'VVVVVV'
and costcenter <> '000000'
and costcenter not in
(select [Name] from dbo.CONTACT_DIVISION))
<<<
I run this on server 1 and i get the data from a database on server2
but SQL on server1 is the server collation Latin1_General_CI_AS
and on SQL on server2 is the server collation Latin1_General_BIN

I know that i can use the collate statment but, i just don't know how
i had to place COLLATE Latin1_General_CI_AS somware in the script, but i just forgot the correct way to do this.

Can someone help me?

Greetings

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-17 : 10:25:01
the syntax is like

columnname COLLATE Latin1_General_CI_AS = someothercolumn COLLATE Latin1_General_CI_AS

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-17 : 11:16:48
If its a comparison I think you only need to put it in once? It then forces both sides to be that way about

If it is an assignment I put it on the right hand end - convert THAT side to be suitable for assignment.
Go to Top of Page

RMH1972
Starting Member

11 Posts

Posted - 2010-08-18 : 07:37:16
Thanx all for your help.

i changed the script to
use marval_Produktie
insert into dbo.CONTACT_DIVISION
([Name], Descrip, Fulong, SLA)
(select costcenter, definition, 0, costcenter
from server2.INT_COMMON.dbo.kpl
where parent = 'VVVVVV'
and costcenter <> '000000'
and costcenter not in
(select [Name]collate Latin1_General_CI_AS from dbo.CONTACT_DIVISION))
;

and this did the trick.

So again thanx,

Greetings
Go to Top of Page
   

- Advertisement -