Collation refers to a set of rules that determines how the data is sorted and compared. Character data is sorted, using rules that defines the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and also defines the character width.
Find collation name for the database
Query
- SELECT DATABASEPROPERTYEX('databaseName', 'Collation') AS Collation_
Example
Find collation name for the columns of a table
Query
- SELECT c.name,c.collation_name FROM sys.columns c
- WHERE c.object_id=OBJECT_ID('Table_Name') AND c.collation_name IS NOT NULL
- SELECT OBJECT_ID('Table_Name')
Example