If you are using a stored procedures that use temporary tables, then be aware that temporary tables created within a stored procedure use the tempdb database’s collation instead of the current user database’s collation. Tempdb is created at installation and is assigned the default collation.
Use 'COLLATE DATABASE_DEFAULT' to resolve the collation conflict, e.g.
SELECT * FROM TableA
WHERE ID COLLATE DATABASE_DEFAULT
IN (SELECT TableAID FROM #temp)
References:
SQL SERVER – Cannot resolve collation conflict for equal to operation
Collation Conflict
Thursday, January 7, 2010
Subscribe to:
Post Comments (Atom)