Variable-length Unicode string data. NDefines the length of a string, and it can be a value between 1 and 4,000. Max Indicates that the maximum storage size is 2 ^ 31-1 bytes (2 GB ). The storage size (in bytes) is twice the actual length of the input data + 2 bytes. nvarchar are National char varying and National Character varying . "> the ISO synonym for nvarchar is National char varying and National Character varying
Varchar [(N|Max)]
Variable Length, non-Unicode string data.NDefines the length of a byte, and it can be a value between 1 and 8,000. Up to 4000 Chinese or 8000 English characters can be saved
Max Indicates that the maximum storage size is 2 ^ 31-1 bytes (2 GB ). The storage size is the actual length of the input data + 2 bytes. varchar are char varying or character varying . "> varchar the ISO synonym is char varying or character varying .
Differences:
Storage space:
Nvarchar uses the Unicode UCS-2 Character Set, each of which uses 2 bytes.
Varchar is stored in a single byte. English characters use one byte and Chinese characters use two bytes. If the data is all English characters, we recommend that you use varchar. If the data contains Chinese characters, we recommend that you use nvarchar.
If the data contains Chinese characters, the varchar type is used in the database. If the data is deployed in the English operating system and the Chinese language is not supported, garbled characters may occur when the database displays the data.