deepti.khatuja (5/4/2016)
didnt understand examples
My example does make the assumption that server collation is not Latin1_general_BIN
you can check server collation with select SERVERPROPERTY('Collation')
If this returns Latin1_general_BIN then change the collation after the collate clause to something different (ie SQL_Latin1_General_CP1_CI_AS).
when creating a table without specifying collation, the collation of character columns will be the collation of the database. Tempdb always has the same collation as server. So by specifying a collation for col1 in my permanent table that is not the server collation and then joining it to col1 in the temp table, a collation mismatch occurs
Msg 468, Level 16, State 9, Line 17
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_BIN" in the equal to operation.