Microsoft SQL Server collation names

Does anyone know what a WS sort property is? Does this have anything to do with Asian type scenarios? MSDN docs explain this as “Sensitivity Width”, but it makes no sense for Swedish or English ...?

+3
source share
2 answers

Here is a good description of width sensitivity: http://www.databasejournal.com/features/mssql/article.php/3302341/SQL-Server-and-Collation.htm

Width Sensitivity

If a single-byte character (half-width) of the same character when it is represented as a double byte character (full width) is processed differently this width is sensitive.

, , , "abc" < > N'abc ', Unicode (2 ), .

, . , .

, , , . , , .

: Latin1_General_CS_AS_WS, , N'a '= N'A' . :

select case when 'a' = 'A' then 'yes' else 'no' end
select case when 'a' = 'a' then 'yes' else 'no' end
select case when N'a' = 'a' then 'yes' else 'no' end 

,

+5

, N'a' = 'a'. , char nchar , Unicode.

, Collation, , ...

DECLARE @T TABLE (
  a VARCHAR(2) COLLATE Latin1_General_100_CS_AS_WS,
  b VARCHAR(2) COLLATE Latin1_General_100_CS_AS_WS )

INSERT INTO @T
VALUES      (N'Æ',
             N'AE');

SELECT LEN(a) AS [LEN(a)],
       LEN(b) AS [LEN(b)],
       a,
       b,
       CASE
         WHEN a = b THEN 'Y'
         ELSE 'N'
       END    AS [a=b]
FROM   @T 

LEN(a)      LEN(b)      a    b    a=b
----------- ----------- ---- ---- ----
1           2           Æ    AE   Y

" Microsoft SQL Server 2008" .

, .

, Latin1_General_100_CS_AS_WS, , , WS .

+1

Source: https://habr.com/ru/post/1792620/


All Articles