SQL Server Collation Options

“CS” / “CI” – Obviously, this one is just case sensitivity between upper and lower case. The default during SQL Server install as well as a database creation is “case insensitive”. With case-insensitive, your queries will execute equally whether you use upper or lower case or a combination of both. However, if you set this to case-sensitive, you will need to get the upper and lower case correct or the query will not return the expected results. Thus, in a “CS” case-sensitive collation, HumanResources.Department is different from humanresources.department and SQL treats them as two different objects.

“AS” / “AI” – This is referring to accent sensitivity. An example would be that ‘a’ is the same as ‘á’ if accent-insensitive is set (using “AI” instead of “AS”), but ‘a’ is not the same as ‘á’ if accent-sensitive is called.

“KS” – Most people will never see or use this one. KS or Kanatype distinguishes between the two types of “Kana” characters for Japan. Those are Hiragana and Katakana. If “KS” is present, SQL Server treats them as equal for sorting purposes.

“WS” – Width sensitive distinguishes between a single-byte character and a double-byte character. If “WS” is not set/selected, SQL Server treats the single-byte and double-byte characters as the same for sorting purposes.

“VSS” – Somewhat relating back to the “KS” or Kanatype, this too is referencing Japanese characters so you most likely will not see nor use this in your day to day activities.

“_SC” – This will always be at the end of the arguments. It only affects how built-in functions work with surrogate pairs. Without “_SC” at the end, SQL Server doesn’t see single supplementary characters; instead it sees two code points that make up a surrogate pair.

You may also like...