N stands for national character, and it is meant for Unicode data. Using Unicode data types, a column can store any character defined by the Unicode Standard, which includes all of the characters defined in the various character sets. Unicode data types take twice as much storage space as non-Unicode data types. Keep in mind that an nchar or nvarchar or ntext datatype takes up twice as much storage as its non-unicode equivalent. This includes space on disk as well as in your buffer cache. So use the unicode data types only where necessary.
VARCHAR and NVARCHAR data types are both character data types that are variable-length. Below is the summary of the differences between these 2 data types:
VARCHAR (n) & NVARCHAR (n) Character Data Type Non-Unicode Data & Unicode Data Maximum Length 8,000 & 4,000 Character Size 1 byte & 2 bytes Storage Size Actual Length (in bytes) & 2 times Actual Length (in bytes)
You would use NVARCHAR data type for columns that store characters from more than one character set or when you will be using characters that require 2-byte characters, which are basically the Unicode characters such as the Japanese Kanji or Korean Hangul characters.
|
No responses found. Be the first to respond and make money from revenue sharing program.
|