Why is sql server storing question mark characters instead of Japanese characters in NVarchar fields?

前端 未结 8 1521
春和景丽
春和景丽 2020-12-01 12:18

I\'m trying to store Japanese characters in nvarchar fields in my SQL Server 2000 database.

When I run an update statement like:

update blah 
set add         


        
8条回答
  •  天涯浪人
    2020-12-01 12:40

    We are using Microsoft SQL Server 2008 R2(SP3). Our table collation is specified as SQL_Latin1_General_CP1_CI_AS. I have my types specified as the n variety

    nvarchar(MAX)
    nchar(2)
    

    ..etc

    To insert Japanese characters I prefix the string with a capital N

    N'素晴らしい一日を'
    

    Works like a charm.

提交回复
热议问题