DBAtlas · Database operations atlas

468: Cannot resolve the collation conflict

SQL Server

What does it mean?

In an operation (JOIN, UNION, WHERE comparison or equality), two string expressions with different collations met and SQL Server could not resolve which collation to apply. The operation was canceled due to the ambiguity.

Why does it happen?

The compared columns are defined with different collations; most often seen when the database collation differs from the server/tempdb collation, or when tables in databases with different collations are joined. Joining temporary tables (tempdb collation) with permanent tables is a classic trigger.

How to fix it

Specify an explicit collation in the comparison: ... WHERE a.col = b.col COLLATE DATABASE_DEFAULT (or a concrete collation name). Use COLLATE DATABASE_DEFAULT when creating temporary table columns. For a permanent fix, align the affected columns/databases to a single consistent collation. If mismatches with tempdb are frequent, DATABASE_DEFAULT is the most practical fix.

Open in DBAtlas →

More from this engine