Search code examples
sqlsql-servercharvarcharnvarchar

char and nchar charactersets


Ok, referencing What is the difference between char, nchar, varchar, and nvarchar in SQL Server?

it tells me that nchar and nvarchar can store UNICODE. So what can be used in CHAR and VARCHAR?


Solution

  • nchar and nvarchar store UCS-2 characters (2 bytes per character, so not UTF-16 as many people assume)

    char and varchar store ASCII characters where the supported codepage is controlled by the selected collation for the columns (or database/server collation for variables and parameters). More info on the collations can be found on msdn