I got this error at work today while trying to insert records into a table in two different databases.

INSERT INTO [Database_1].[dbo].[table_1]
SELECT *
    
FROM [Database_2].[dbo].[table_2]
    
WHERE ID_GUID = '3F77803D-A123-5340-90DA-FDA2624BCDF6'
        
AND ID2_GUID NOT IN (
    
SELECT ID2_GUID
        
FROM [Database_1].[dbo].[table_1])


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


After doing some google searches, I realized that it looks like I have different collation on the two databases or tables. So I had to “force” the collation of comparison between the columns.


Below is my final solution. 

INSERT INTO [Database_1].[dbo].[table_1]
SELECT *
    
FROM [Database_2].[dbo].[table_2]
    
WHERE ID_GUID = '3F77803D-A123-5340-90DA-FDA2624BCDF6'
        
AND ID2_GUID COLLATE SQL_Latin1_General_CP1_CI_AI NOT IN (
    
SELECT ID2_GUID
        
FROM [Database_1].[dbo].[table_1])


Let me know your thoughts on this. I hope it helps! 🙂