DIFFERENCE BETWEEN NCHAR AND NVARCHAR DATA TYPE IN SQL SERVER 2005

Similarities & Differences.

1.Both are unicode character data type.

2.Both can store maximum of 4000 characters.

3.Nchar data type is fixed length while Nvarchar data type is of variable length.

4.If the number of characters entered in an Nchar data type column
is less than the specifed column then spaces are appended to it to fill
up the whole length.

5.The Storage size for Nchar is 2 times n bytes while for Nvarchar is 2 times the no of characters entered ( in bytes ).

6.One should use Nchar data type when the data value in a column are expected to be consistently close to the same size.

7.One should use the Nvarchar when the data values in a column are expected to vary considerably in size.

Pawan Kumar
Pawankkmr@hotmail.com

Advertisements