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?
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
>> 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.
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
ASKER