What is the difference between varchar and nvarchar in the database? varcharnvarchar
Differences between varchar and nvarchar in Databases
1. varchar is stored in bytes, while nvarchar is stored in characters (two bytes. That is to say, varchar stores one English letter in one byte and one Chinese Character in two bytes, while nvarchar stores one English letter in two bytes and one Chinese Character in two bytes.
2. varchar (n) indicates that the length is n Bytes, and nvarchar (n) indicates that the length is n characters (2n bytes ).
3. nvarchar is used to store double-byte characters such as Chinese characters. Therefore, if you confirm that the field value does not contain English characters, try to use nvarchar for storage.
4. Another benefit of using nvarchar is that Chinese characters do not change to "?" during database operations "?? .