Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max size of varchar(max) in SQL Server 2000

I would like to know what is the maximum size of varchar in SQL Server 2000. While I was googling somewhere it was written 8000 characters and somewhere it was written 8060 bytes. Which one is correct?

like image 967
Kumar Avatar asked Jan 16 '10 15:01

Kumar


People also ask

What is the limit of VARCHAR Max in SQL Server?

varchar [ ( n | max ) ] Variable-size string data. Use n to define the string size in bytes and can be a value from 1 through 8,000 or use max to indicate a column constraint size up to a maximum storage of 2^31-1 bytes (2 GB).

Is VARCHAR 255 the max?

Storage Information : The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used. Make sure you are aware of the effects of a multi-byte character set. VARCHAR(255) stores 255 characters, which may be more than 255 bytes.

Is VARCHAR Max same as VARCHAR 8000?

About varchar(MAX)If your data is longer than 8000 characters varchar(MAX) is what you need. You can store up to 2GB size of data this way. In varchar(MAX) fields if your data size is shorter than 8000 characters your data is stored in row automatically (therefore the data execution is faster).


1 Answers

Varchar is 8000 and nvarchar is 4000.

Here's the varchar msdn reference:
http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx

like image 117
Joel Coehoorn Avatar answered Oct 16 '22 09:10

Joel Coehoorn