It is not clear to me how a varchar(max)
is declared or used in an SQL Server e.g. 2005
Is a variable declared as varchar(300000)
for example considered as a varchar(max)
?
E.g. I am seeing in a DB in a table a variable is declared as varchar(8000)
.
Can I simply increase it to varchar(300000)
?
Thanks
SQL Server Variable – How to Increase Variable Size
database-administrationsqlsql server
Related Topic
- Sql-server – How to install SQL Server 2000, SQL Server 2005 and SQL Server 2008 on a single machine
- Sql-server – how many tables can an MS SQL database hold
- Sql-server – Tools for planning a SQL Database size requirement
- Sql-server – SQL Server 2005 ASYNC_NETWORK_IO waits: can we just increase network buffer size? (How?)
- Sql-server – Row size, indexes and varchar(max)
- Sql-server – sql server limitation of data size
Best Answer
When you define a maximum size explicitly, then you cannot define higher than
CHAR(8000)
/VARCHAR(8000)
orNCHAR(4000)
/NVARCHAR(4000)
.When you define a variable as
CHAR(max)
orVARCHAR(max)
, you set the maximum size of that variable to2GB
.There is no way to define a variable with a maximum size between
8000 bytes
and2GB
.