Find all columns with non default collation

It’s easy to retrieve this data from catalog and information schema views.

declare @default_Collation sysname ;

select  @default_Collation = collation_name
from    sys.databases
where   database_id = db_id()

select  c.TABLE_SCHEMA ,
        c.TABLE_NAME ,
        c.COLUMN_NAME ,
        c.COLLATION_NAME
from    information_schema.columns c
where   c.collation_name <> @default_Collation
        and c.COLLATION_NAME is not null
Advertisements