Unicode Data Types

SQL Server 7.0 supports Unicode data types, which makes it easier to store data in multiple languages within one database by eliminating conversion of characters and installation of multiple code pages. Unicode stores character data using 2 bytes for each character (rather than 1 byte). There are 65,536 different bit patterns in 2 bytes; therefore, Unicode can use one standard set of bit patterns to encode each character in all languages, including languages such as Chinese that have many characters. Programming languages also support Unicode data types.

The fact that Unicode data needs twice as much storage space is offset by the elimination of the need to convert extended characters between code pages. The new data types that support Unicode are ntext, nchar, and nvarchar. They are the same as text, char, and varchar except for the wider range of characters supported and the increased storage space used.

Traditional non-Unicode data types in SQL Server allow the use of characters that are defined by a particular character set. A character set is chosen during SQL Server setup and is immutable throughout the life of the installation. By using Unicode data types, a column can store any character that is defined by the Unicode Standard, which includes all characters defined in the various character sets.