How do I show ☺♦♦ characters in SQL Server?

97 views Asked by At

You can I display special Unicode characters in my result set on my SQL Server?

e.g. How can i display those characters ☺♦♦?

1

There are 1 answers

2
Ionic On BEST ANSWER

Well due to the fact that your question is very unspecific here are some solutions.

You need to specify a string as unicode string. This can be achieved by adding an N in front of the string. See example:

SELECT N'☺♦♦' as a, '☺♦♦' as b

Result:

a    b
---- ----
☺♦♦  ???

If you want to store those symbols, you need a type as nvarchar or nchar.

Hopefully this helps you.