ERROR - "Cannot resolve the collation conflict between SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AS_KS_WS in the equal to operation."
Don’t panic if you get this error while joining your tables. There is a simple way to solve this. It happens because of the different collation settings on two columns we are joining.
The first step is to figure out what are the two collations that have caused the conflicts.
Statements
- Select DATABASEPROPERTYYEX('DB1',N'Collation')
- Select DATABASEPROPERTYYEX('DB2',N'Collation')
Now, we have to do something similar to CAST, called Collate (FOR Collation).
Refer to the example below.
- select * from Demo1.dbo.Employee emp
- join Demo2.dbo.Details dt
- on (emp.email =dt.email COLLATE SQL_Latin_General_CP1_CI_AS)

Join the conversation! Your thoughts help the community grow.