In database systems, collation determines how data is sorted and compared in a database. For example, when you run a query using the ORDER BY
clause, collation determines whether or not uppercase letters and lowercase letters are treated the same.
In SQL Server, collation is specified at the server level, the database level, and the column level.
Collation can also be applied to a character string expression to apply a collation cast. For example, you can use the COLLATE
clause in a T-SQLÂ SELECT
statement to specify the collation to be used. Like this:
USE Music; SELECT ArtistId, ArtistName FROM Artists ORDER BY ArtistName COLLATE Latin1_General_CI_AI;
That collation uses CI
for case-insensitive, and AI
for accent-insensitive.
Continue reading