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

前端 未结 8 1500
春和景丽
春和景丽 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:43

    I can almost gurantee that the data type is not unicode. If you want to learn more you can check Wikipedia for information on Unicode, ASCII, and ANSI. Unicode can store more unique characters, but takes more space to store, transfer, and process. Also some programs and other things don't support unicode. The unicode data types for MS SQL are "nchar", "nvarchar", and "ntext".

    0 讨论(0)
  • 2020-12-01 12:44

    The code is absolutely fine. You can insert an unicode string with a prefix N into a field declared as NVARCHAR. So can you check if Address is a NVARCHAR column. Tested the below code in SQL Server 2008R2 and it worked.

    update blah 
    set address = N'スタンダードチャ'
    where key_ID = 1
    

    enter image description here

    0 讨论(0)
提交回复
热议问题