Jan 21, 2014

Width sensitive and insensitive collation examples in sql server


In collation name meaning WS
WS: Width sensitive

Example of width insensitive comparison in sql server

IF 'm3' = 'm³' COLLATE Latin1_General_CI_AI
    SELECT 'Width insensitive'
ELSE
    SELECT 'Width sensitive'  

Output:  Width insensitive

Example of width insensitive comparison in sql server
   
IF 'm3' = 'm³' COLLATE Latin1_General_CI_AI_WS
    SELECT 'Width insensitive'
ELSE
    SELECT 'Width sensitive'

No comments:

Post a Comment