开发者

Other language string in SQL Server 2005

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜