- Error number
- 468
- Severity
- 16 (user-correctable error)
- State
- 9
- Product
- Microsoft SQL Server Database Engine
- Versions
- All supported SQL Server versions (2016 to 2025), Azure SQL Database, Azure SQL Managed Instance
- Category
- Data Type & Conversion
- Last reviewed
- 23 October 2026
On this page
What it means
Error 468 means a comparison, join or UNION combines two text columns with different collations, and SQL Server cannot decide which collation's sorting and comparison rules to use.
Every char, varchar, nchar, nvarchar and text column has a collation, which decides how text is sorted and compared (case, accents, code page). When two column values meet in =, <, IN, a JOIN condition or a UNION, both sides must use one collation. A literal or variable simply adopts the column's collation, but two columns with different explicit collations have equal rank, so neither wins and the statement fails at compile time with 468 at severity 16.
The message names both collations and the operation, for example equal to or UNION. The order of the two names does not tell you which side of your query is which; check the column collations with the diagnostic query. The most frequent real-world case is a temporary table: temp tables take the collation of tempdb (the server collation), so in a database with a different collation, joining a temp table to a permanent table conflicts.
Common causes
- A join between tables from two databases, or two vendors' schemas, created with different collations.
- A temporary table or table variable compared with a permanent table in a database whose collation differs from the server (tempdb) collation.
- A column created or altered with an explicit COLLATE clause that differs from the rest of the database.
- A database restored or attached from another server that uses a different default collation.
- A UNION, INTERSECT or EXCEPT that combines text columns with different collations.
Diagnose it
Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.
Compare the collations of the columns in the query
SELECT OBJECT_NAME(c.object_id) AS table_name, c.name AS column_name, c.collation_name
FROM sys.columns AS c
WHERE c.object_id IN (OBJECT_ID(N'dbo.Customers'), OBJECT_ID(N'dbo.Imports'))
AND c.collation_name IS NOT NULL
ORDER BY table_name, c.column_id; Two different collation_name values on the columns you compare are the cause.
Compare server, tempdb and database collations
SELECT CAST(SERVERPROPERTY('Collation') AS sysname) AS server_collation,
CAST(DATABASEPROPERTYEX('tempdb', 'Collation') AS sysname) AS tempdb_collation,
CAST(DATABASEPROPERTYEX(DB_NAME(), 'Collation') AS sysname) AS this_database; If this_database differs from tempdb_collation, every temp table text column will conflict with your tables unless you declare its collation.
Find columns that differ from the database default
SELECT OBJECT_SCHEMA_NAME(c.object_id) + '.' + OBJECT_NAME(c.object_id) AS table_name,
c.name AS column_name, c.collation_name
FROM sys.columns AS c
JOIN sys.tables AS t ON t.object_id = c.object_id
WHERE c.collation_name IS NOT NULL
AND c.collation_name <> CAST(DATABASEPROPERTYEX(DB_NAME(), 'Collation') AS sysname)
ORDER BY table_name, column_name; Columns that will conflict with ordinary columns in the same database. A short list is usually the result of one import or migration.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Choose a collation in the query with COLLATE
Read-onlyAdd COLLATE to one side of the comparison. Use the collation whose rules you want (for example case-insensitive), or DATABASE_DEFAULT. An index on a column wrapped in a different collation may no longer be usable for seeks, so put COLLATE on the smaller side when you can.
SELECT c.name
FROM dbo.Customers AS c
JOIN dbo.Imports AS i
ON i.code = c.code COLLATE Latin1_General_CI_AS;
Declare temp table text columns with COLLATE DATABASE_DEFAULT
Changes schemaThe temp table then uses the collation of the current database instead of tempdb, so joins with permanent tables work in any database on any server.
CREATE TABLE #Codes (
code VARCHAR(10) COLLATE DATABASE_DEFAULT
);
Align the column with the rest of the database
Changes schemaFor a permanent fix, change the odd column to the database collation. Indexes, constraints and statistics that use the column must be dropped first and recreated afterwards; check that no code relies on the old comparison rules (for example case sensitivity).
Caution: Changing a collation can change which values count as equal or unique. A unique index can fail to rebuild if, for example, a case-sensitive column holds both ABC and abc and the new collation is case-insensitive.
ALTER TABLE dbo.Imports
ALTER COLUMN code VARCHAR(10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;
Examples
Joining two columns with different collations
CREATE TABLE dbo.Customers (code VARCHAR(10) COLLATE SQL_Latin1_General_CP1_CI_AS, name VARCHAR(50));
CREATE TABLE dbo.Imports (code VARCHAR(10) COLLATE Latin1_General_CI_AS, name VARCHAR(50));
GO
SELECT c.name
FROM dbo.Customers AS c
JOIN dbo.Imports AS i ON i.code = c.code;
Msg 468, Level 16, State 9, Line 3 Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
A temp table in a database with a different collation from tempdb
Run in a database created with COLLATE Latin1_General_CI_AS on an instance whose server (and so tempdb) collation is SQL_Latin1_General_CP1_CI_AS. On your server the names in the message are your database and tempdb collations.
-- Database collation: Latin1_General_CI_AS; tempdb: SQL_Latin1_General_CP1_CI_AS
CREATE TABLE dbo.Customers (code VARCHAR(10), name VARCHAR(50)); -- database collation
CREATE TABLE #Codes (code VARCHAR(10)); -- tempdb collation
SELECT c.name
FROM dbo.Customers AS c
JOIN #Codes AS t ON t.code = c.code;
Msg 468, Level 16, State 9, Line 5 Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
A UNION of columns with different collations
CREATE TABLE dbo.Customers (code VARCHAR(10) COLLATE SQL_Latin1_General_CP1_CI_AS);
CREATE TABLE dbo.Imports (code VARCHAR(10) COLLATE Latin1_General_CI_AS);
GO
SELECT code FROM dbo.Customers
UNION
SELECT code FROM dbo.Imports;
Msg 468, Level 16, State 9, Line 1 Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the UNION operation.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
How to prevent it
Pick one collation for the server and its databases and keep to it; do not add COLLATE clauses to individual columns without a clear reason such as a case-sensitive code. In code that creates temp tables, write COLLATE DATABASE_DEFAULT on every text column so it works in any database.
Check the collation before restoring or migrating a database to a different server, and test cross-database joins after the move. For joins in general, see the SQL joins guide.
Common questions
How do I fix "Cannot resolve the collation conflict" quickly?
Add COLLATE DATABASE_DEFAULT (or a specific collation name) to one side of the comparison or join condition. For temp tables, add COLLATE DATABASE_DEFAULT to their text columns.
Why does it only happen with temp tables?
Temp tables live in tempdb and take its collation, which is the server collation. If your database was created with a different collation, its columns conflict with temp table columns.
Does comparing a column with a literal cause error 468?
No. Literals and variables take the collation of the column they are compared with. The conflict needs two expressions that each carry their own collation, typically two columns.
Learn more on CodeWithSQL
Official documentation
- COLLATE (Transact-SQL)
- Collation precedence (Transact-SQL)
- Collation and Unicode support (Microsoft Learn)
- Database Engine events and errors 0 to 999
Last technically reviewed 23 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.