Sql – “SQL_Latin1_General_CP1_CI_AS” in the equal to operation

sqlsql serversql-server-2008

Hi i am new to SQL queries

My query is

ALTER TABLE ValidIBAN NOCHECK CONSTRAINT FK_ValidIBAN_Countries
UPDATE t 
 SET t.CountryID = s.Corrected
from #TempNewCountryID s,Countries t
where 
s.Existing = t.CountryID

but after running this query i am getting

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

Error Please suggest.

Best Answer

Depends on which logic is required (Accent sensitive or insensitive), use COLLATE on both sides of your equal sign: WHERE s.Existing COLLATE SQL_Latin1_General_CP1_CI_AI = t.CountryID COLLATE SQL_Latin1_General_CP1_CI_AI