locked
Chinese and Japanese characters in database RRS feed

  • Question

  • I have Customer table in which Name column can contain Chinese characters. I have given it's datatype as NVARCHAR. I am writing simple SELECT statement. But it is showing question marks instead of Chinese characters. What should I do to get correct data? In Below Image, you can see that after 2nd statement, @NAME variable value automatically gets those question marks which is not returning correct answer.

    Friday, March 20, 2015 11:18 AM

Answers

  • Hello,

    You have to add the Unicode literal N in front of the string, like

    SET @NAME = N'here comes the text';


    Olaf Helper

    [ Blog] [ Xing] [ MVP]


    Friday, March 20, 2015 11:22 AM

All replies

  • Hello,

    You have to add the Unicode literal N in front of the string, like

    SET @NAME = N'here comes the text';


    Olaf Helper

    [ Blog] [ Xing] [ MVP]


    Friday, March 20, 2015 11:22 AM
  • Thank you Olaf :)

    It worked for me.

    Monday, March 23, 2015 2:39 AM