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
This entry was posted in T-SQL Tips & Tricks. Bookmark the permalink.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s