Thursday, April 22, 2010

Collation issue when querying two tables on a join

Error




Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and
"SQL_Latin1_General_CP850_BIN" in the equal to operation.



Issue



Column collation setting for user_table\variable_table\temp_table for data
type char\text\varchar columns should be the same while comparison.


Fix




i.e.


DECLARE @DBList as table
( DatabaseID int, DatabaseName varchar(128) COLLATE SQL_Latin1_General_CP850_BIN not null)

No comments:

Post a Comment