In SSMS v17.9, connecting to an SQL Server 14.0.1000 instance, the system treats these two character the same: 𦍌
and 𧾷
I set a [Kanji] table with the [Char] NVARCHAR(2) as the primary key. After I added "𦍌", I cannot add "𧾷" since it threw a "key duplication" error.
I ran this T-SQL:
IF ( N'𦍌' = N'𧾷') PRINT 'true' ELSE PRINT 'false'
The result prints out 'true'.
The SQL_Latin1_General_CP1_CI_AS collation is a SQL collation and the rules around sorting data for unicode and non-unicode data are different. The Latin1_General_CI_AS collation is a Windows collation and the rules around sorting unicode and non-unicode data are the same.
Collations in SQL Server provide sorting rules, case, and accent sensitivity properties for your data. Collations that are used with character data types, such as char and varchar, dictate the code page and corresponding characters that can be represented for that data type.
Click Start > All Programs > Accessories > Command Prompt. At the command line, type regedit.exe. Note: By default, SQL Server Express instances are named sqlexpress, but this value may be different if another name was used when SQL Server Express was installed.
you have to use proper collation,
IF ( N'𦍌' COLLATE Chinese_Simplified_Stroke_Order_100_CI_AI = N'𧾷' COLLATE Chinese_Simplified_Stroke_Order_100_CI_AI) PRINT 'true' ELSE PRINT 'false'
collation can set on the fly in select statement or in DB object level
read more about collations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With