Thursday, March 13, 2008

Differences between VARCHAR and NVARCHAR

VARCHAR is an abbreviation for variable-length character string with a maximum limit of 8000 bytes.

NVARCHAR are the Unicode equivalents of VARCHAR. Unicode uses two bytes per character, which allows the storage of multilingual characters with a maximum length of 4000 bytes.

The most common use of NVARCHAR is to store character data that is a mixture of English and non-English symbols, such as English and Chinese. Other languages have an extended set of character codes that need to be saved and this datatype allows for this extension. If your database will not be storing multilingual data you should use the VARCHAR datatype instead. This is because to store the extended character codes for other languages, NVARCHAR requires twice as much space as VARCHAR.

VARCHAR and NVARCHAR in SQL SERVER 2005
One major change to both of the datatypes in SQL SERVER 2005 is the creation of VARCHAR(MAX) and NVARCHAR(MAX) which allows you to stored up to 2GB in a single variable. And it also allows you to use these data types as parameters in your stored procedure, internal variables etc.

7 comments:

Anonymous said...

Thank you very much for such a good differentiation.

Keyur said...

Thank you very much....

OCRS said...

Great, that was all i needed to know, thanks alot!

Anonymous said...

Very Good

Anonymous said...

Very Good

Anonymous said...

thnx a lot

Anonymous said...

thank u

 

Get paid for your opinions! Click on the banner above to join Planet Pulse. Its totally free to sign up, and you can earn UNLIMITED. Find out more by visiting PLANET PULSE.
July Code Blog Copyright © 2010 Blogger Template Designed by Bie Blogger Template