Sql – How to see all the “special” characters permissible in a varchar or char field in SQL Server?

sqlsql-server

Where can I see all the non-visible characters stored on a varchar or char field in SQL Server? e.g. \n (new-line), \r (carriage return) and other "non-printable" characters?

How to print them (as they are not printable but perform some action on the text)?

Best Solution

You probably just need to see the ASCII and EXTENDED ASCII character sets. As far as I know any of these are allowed in a char/varchar field.

If you use nchar/nvarchar then it's pretty much any character in any unicode set in the world.

enter image description here

enter image description here