Link to home
Create AccountLog in
Avatar of Mr_Shaw
Mr_Shaw

asked on

VARCHAR (max) size?

I am creating a column which will be VARCHAR(MAX).

On http://msdn.microsoft.com/en-us/library/ms176089.aspx

"Variable-length, non-Unicode character data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of data entered + 2 bytes. The data entered can be 0 characters in length. The ISO synonyms for varchar are char varying or character varying".

Does this mean it will be 1 byte for each character + 2 bytes?
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of Mr_Shaw
Mr_Shaw

ASKER

thanks
>> A character is more than 1 byte in size. <<
For varchar (supports ASCII characters): 1 character = 1 byte.  No more, no less.

Perhap you were thinking of nvarchar which supports double-byte (unicode) characters.
Yes, that is correct. Sorry. :P