The Unicode standard and character sets are closely related but distinct concepts. Both represent a set of letters, numbers, and symbols. A character set has 256 possible values (28), and a number of character sets exist. The single Unicode standard has 65,536 possible values (216). This greater range of values is possible for Unicode data because of the increased storage space it uses. The Unicode standard and character sets fulfill the same purpose, to represent a set of character data, but they differ in how they fulfill that purpose.
These differences between Unicode and character set data result in different implementations, as well. Unicode and character set data cannot be stored in the same fields; a set of data types exist for each.
Character set | Unicode |
---|---|
char | nchar |
varchar | nvarchar |
text | ntext |
Microsoft® SQL Server™ recognizes only one character set at a time. The char, varchar, and text data types can store data made up of the 256 possible values of that particular character set. To change the character set, you must rebuild the databases and reload the data.
SQL Server always recognizes the Unicode standard. The nchar, nvarchar, and ntext data types can store data made up of the 65,536 possible values of the Unicode standard.