Mahmoud ElMansy: knowledge meant to be free

Cannot resolve the collation conflict

I faced today this error when comparing two data in different databases
I got that error. “Cannot resolve the collation conflict between “Arabic_CI_AS” and “SQL_Latin1_General_CP1_CI_AS” in the equal to operation?“.
The solution was simple.

SELECT column_name  FROM TABLE_1 WHERE  column_name NOT IN
( SELECT CONVERT(VARCHAR,  column_namecollate Arabic_CI_AS)
FROM SomeDataBase.dbo.TABLE_2 )
SELECT column_name  FROM TABLE_1 WHERE  column_name NOT IN
( SELECT column_name1 COLLATE Arabic_CI_AS
FROM SomeDataBase.dbo.TABLE_2 )

This will resolve that error.