Collation error? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Collation error?

What is wrong with this query? SELECT C.COL_DAT AS CCOL, S.COL_DAT AS SCOL FROM CAL AS C, SCH AS S
WHERE S.SSN=123456789 AND S.REGION=’N’ AND
S.COL_DAT<=’2005-06-04′ AND S.COL_DAT >= ‘2005-05-22’
AND S.COL_DAT=C.COL_DAT I get the following error: Server: Msg 446, Level 16, State 9, Line 1
Cannot resolve collation conflict for equal to operation. If I remove the last line of the query it runs. (Not the correct results, but it runs) COL_DAT in both tables is a char(10). Both tables only have dates in the format YYYY-MM-DD in the COL_DAT column. ?????? Live to Throw
Throw to Live
Use the statement with .. "collate database_default" COLLATE clause which can be defined to a column specific collation. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
mpre details
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_da-db_7ory.asp
]]>