views:

10

answers:

1

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?

+2  A: 

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.

David M