[ Content | View menu ]
Miri Day 2 017 - _MG_5344.jpgMiri Day 2 028 - _MG_5411.jpgMiri Day 2 016 - _MG_5338.jpgHong Kiat & Cely's ROM 092-_MG_0788Hong Kiat & Cely's ROM 091-_MG_0772Foon Yee Hen's Night 177-_MG_5709Chung Lern & Stephanie Couple Photoshoot 044-_MG_1244Chung Lern & Stephanie Couple Photoshoot 009-_MG_0957Sunway University 026 - _MG_3870

Difference Between char, nchar, varchar and nvarchar

Written on September 8, 2008 by CincauHangus

In MSSQL:

char[(n)]

Fixed-length character data in single-byte character sets with length of n characters. n must be a value from 1 through 255. Storage size is n bytes.

nchar[(n)]

Fixed-length character data in multibyte character sets with length of n characters. n must be a value from 1 through 255. Storage size is n*@@ncharsize bytes.

varchar[(n)]

Variable-length character data in single-byte character sets with length of n characters. n must be a value from 1 through 255. Storage size is the actual length of the data entered, not n bytes.

nvarchar[(n)]

Variable-length character data in multibyte character sets with length of n characters. n must be a value from 1 through 255. Storage size, in bytes, is the actual number of characters entered * @@ncharsize.

Remarks

When n is not specified in a data definition, the default length is 1.

Filed in: Programming.

No Comments

Write comment - TrackBack - RSS Comments

Write comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word