开发者

Other language string in SQL Server 2005

开发者 https://www.devze.com 2022-12-31 09:07 出处:网络
I am trying you insert some string which is not in English (other language开发者_运维技巧). when i fetch back they are not correct. They comes like \"?????\".

I am trying you insert some string which is not in English (other language开发者_运维技巧). when i fetch back they are not correct. They comes like "?????".

But at the same time when I enter the string through the SQL Server UI (SSMS) to enter the string, it works OK.

What could be the solution please?


Prefix the string literal with an N:

INSERT INTO table VALUES (N'Français')

This marks it as a Unicode string not an ASCII one. Oh, and make sure the data type is Unicode as well obviously - nvarchar not varchar for instance.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号