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)
 collation

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2010-08-03 : 04:36:43
i get this error when i do join between two tables (not in same server)
the first table- TABLEA on sql 2000 the collation is Hebrew_CI_AS
the Second table- TABLEB on sql 2005 the collation is Hebrew_CI_AS

why i get this error?

Msg 468, Level 16, State 9, Line 1
Cannot resolve the collation conflict between "Hebrew_CI_AS" and "Hebrew_CI_AI" in the equal to operation.

xpandre
Posting Yak Master

212 Posts

Posted - 2010-08-03 : 04:57:14
select ...
where a=b

a has collation Hebrew_CI_AS and b has Hebrew_CI_AI
Go to Top of Page

inbs
Aged Yak Warrior

860 Posts

Posted - 2010-08-03 : 05:02:46
ok,

but in the properties in the table b (SQL 2005) the collation is
Hebrew_CI_AS and not Hebrew_CI_AI
Go to Top of Page

xpandre
Posting Yak Master

212 Posts

Posted - 2010-08-03 : 05:17:39
I am not sure about your table collation , but I guess what you see is the default database collation.

what does this query give for each of your column?
select sysobjects.name,syscolumns.name,collation from syscolumns inner join sysobjects on syscolumns.id = sysobjects.id
where syscolumns.name = '<columnname>' and sysobjects.name = '<tablename>'
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-03 : 05:39:58
try

where a collate database_default=b collate database_default

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

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-03 : 08:41:19
Yeah, that will probably fix it, but I'm with the O/P that it seems that both columns were already the same collation, and thus the error is unexpected/unexplained, no?

As xpandre said, the exact collation of each column needs checking, just to make sure that nothing has "disguised" the actual collation along the way ...
Go to Top of Page
   

- Advertisement -