|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, December 02, 2009 12:19 AM
Points: 108,
Visits: 248
|
|
hello,
what is the difference between the NCHAR() AND NVARCHAR()
Regards: Dastagiri.D
Thanks Dastagiri.D
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:02 AM
Points: 3,131,
Visits: 1,056
|
|
nchar
Fixed-length Unicode character data of n characters. n must be a value from 1 through 4,000. The storage size is two times n bytes. The ISO synonyms for nchar are national char and national character.
nvarchar
Variable-length Unicode character data. n can be a value from 1 through 4,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size, in bytes, is two times the number of characters entered + 2 bytes. The data entered can be 0 characters in length. The ISO synonyms for nvarchar are national char varying and national character varying
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:43 AM
Points: 210,
Visits: 437
|
|
nChar() is Fixed length and nVarChar is variable length.
In practice, the disk space used is nChar(5) => will always use 12 Bytes ( 2 *n ) +2 nVarChar(5) = > uses 3 ( ( 1*2)+2 Bytes ) up to 12 Bytes depending on number of characters entered and ansi-Padding settings.
Check BOL nChar and nVarchar for more details
|
|
|
|