whitespace - Sql server string comparison problem with chinese white-space -


I have a record with a following value for a nerve column in a sql server database: '穂 坂' second letter The Unicode value is 0x20, which is the character of a simple space.

There is a unique key constraint on that column.

When I try to insert the following values, I get a unique key violation: '穂 坂' In this string, the second letter is Unicode value 0x3000, which is a Chinese space character.

Why do I get a unique key violation? Why does SQL Server "convert" the character of Chinese white-space into a simple place?

Thanks in advance for any insights! My match is by way of SQL_Latin1_General_CP1_CI_AS.

First you can use the type of approval string in SQL. Second, you can use the Unicode strings introduced by the N prefix.

Examples:

  Select Cast (VARBINARY (32)) as N '穂 坂' COLLATE Chinese_Simplified_Pinyin_100_BIN2  

=> 0x427A20004257

  Cast Caste (N '穂 坂' Wireless as Coalated Chinese Simplified_ Pinyin_100_BIN2 (32))  

=> 0x427A00304257


Comments