Search code examples
sql-serverspecial-characterssql-server-2014sqldatatypesnon-ascii-characters

what data type to use to stored these characters: '●▬ஜ۩卐۩ஜ▬●'


How can I deal with ( select and print ) the following set of characters:

DECLARE  @V NVARCHAR(108)
SELECT @V = '●▬▬▬▬▬▬▬▬▬ஜ۩卐۩ஜ▬▬▬▬▬▬▬▬▬●'

SELECT @V
PRINT @V

even when debugging the contents of the variable is not showing properly.

enter image description here


Solution

  • You missed N before code..read here more on why we need to append N'' before characters..https://softwareengineering.stackexchange.com/questions/155859/why-do-we-need-to-put-n-before-strings-in-microsoft-sql-server

    DECLARE  @V NVARCHAR(1080)
    SELECT @V = N'●▬▬▬▬▬▬▬▬▬ஜ۩卐۩ஜ▬▬▬▬▬▬▬▬▬●'
    
    SELECT @V
    PRINT @V