entity framework - How to use Unicode string for primary key in SQL Server -
I am having trouble entering a record with a primary key that only changes according to certain Unicode characters. For example, if I already have a record in the database with the primary key of The primary key is defined as the SQL_Latin1_CP1 matched does not meet all Unicode codepoints. Use new people after SQL Server 2008, for example The Unicode character you are using comes within the 16-bit character limit, so the complementary characters are not yet in play Come on. "test" and I try to insert another record containing the primary
"test + '\ U13A4' + '\ u13B4' + '\ u13B9' " I get a duplicate key error I am using EF5 with SQL Server 2012.
nvarchar and the collation is set to
SQL_Latin1_General_CP1_CI_AS . If the primary unicode characters are present then it can just take a look at the primary key, but if it is different in Unicode special characters (as in the example above), I get a duplicate key error when I insert it. How can you get this issue?
Select n'test 'collate SQL_Latin1_General_CP1_CI_AS union n'test' + nchar (5028) + nchar (5044) + nchar (5049) - Result: 1 row
select n'test 'collate Latin1_General_100_CI_AS Choose Union N'test' + nchar (5028) + nchar (5044) ) + Nchar (5049) - Result: 2 rows
Comments
Post a Comment