Wednesday 19 November 2008

Cannot resolve the collation conflict

Joining two tables on a name column...
select * from tableOne as a
join tableTwo as b
on
a.name = b.name
...came up with this error...
Msg 468, Level 16, State 9, Line 1
Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
Solution was to change the collation of the appropriate column:
select * from tableOne as a
join tableTwo as b
on
a.name COLLATE Latin1_General_CI_AS = b.name

No comments: