List all Table Columns that have Collations different than the SQL Server Database

To list all column collations for character-based columns (char, varchar, text, nchar, nvarchar, and ntext data) for all user-defined tables in a database (in this example we will use AdventureWorks database) that have different collation than the Database collation, run this query:

USE AdventureWorks
SET @DB_Collation=CAST(DATABASEPROPERTYEX(@DB_Name, 'Collation') as varchar(50))
SELECT as 'Schema_Name', as Table_Name, AS Column_Name,
c.collation_name AS Collation,
@DB_Collation AS Database_Collation
FROM sys.schemas s
INNER JOIN sys.tables t
ON t.schema_id = s.schema_id
INNER JOIN sys.columns c
ON c.object_id = t.object_id
WHERE collation_name is not null
AND collation_name <> @DB_Collation
ORDER BY Column_Name


To see how to List all Column Collations for all Tables in a SQL Server Database, read related blog post:
List all Column Collations for all Tables in a SQL Server Database

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">