Cannot resolve the collation conflict…

By Dries Marckmann
November 26, 2010
0

Ever tried to do a join on text columns? Like this:

SELECT * from LocationAustralie la 
left join steps s on la.StepText = s.Value 

If your tables have different collations you get the error message:

Msg 468, Level 16, State 9, Line 2: Cannot resolve the collation
conflict between "Latin1_General_CI_AS" and 
"SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

 

Two of my colleagues had this problem in a single week and asked whether I had a solution. I have…

So here is the solution: the keyword COLLATE.

Just add the collate to one of the columns on the join

SELECT * from LocationAustralie la
left join steps s on la.StepText = s.Value collate Latin1_General_CI_AS

Happy Querying!

Comments: 0

Leave a Reply

Your email address will not be published. Required fields are marked *