Accent Sensitive and Accent Insensitive Collation in SQL Server explained

Accent sensitive collation considers the accented and unaccented versions of letters to be identical for sorting purposes.

Here is an example to test Accent sensitive (AS) and Accent insensitive (AI) collation difference.

We will compare values 'a' and 'á' in an Accent insensitive collation:

IF 'a' = 'á' COLLATE Latin1_General_CI_AI
SELECT 'Values are the same'
ELSE
SELECT 'Values are different'

Here is the result:

...which means that comparing 'a' to 'á' in an Accent insensitive collation treats the accented and unaccented versions of letters to be identical.

Then we will compare values 'a' and 'á' in an Accent sensitive collation:

IF 'a' = 'á' COLLATE Latin1_General_CI_AS
SELECT 'Values are the same'
ELSE
SELECT 'Values are different'

Here is the result:

...which means that comparing 'a' to 'á' in an Accent sensitive collation treats the accented and unaccented versions of letters differently.

See also:
Case Sensitive and Case Insensitive Collation in SQL Server explained
Width Sensitive and Width Insensitive Collation in SQL Server explained

If the post helped you, please share it:
Pin It

4 comments to Accent Sensitive and Accent Insensitive Collation in SQL Server explained

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">