Skip to main content
Frequently Asked Questions - SQL Server 2005 - VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX)
Entry Date: Rate:
Site:
Keywords:
RSS Description:

1. What are the new data types or enhanced data types in SQL Server 2005??

2. What’s the maximum length for VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) data types?

3. Since you can use VARCHAR(MAX), can I define any length for a VARCHAR data type such as VARCHAR(10000)?

4. Will VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) replace TEXT, NTEXT and IMAGE data types?

5. Can I declare a local variable of VARCHAR(MAX), NVARCHAR(MAX) or VARBINARY(MAX)?

6. If there are VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) data types, are there also CHAR(MAX), NCHAR(MAX) and BINARY(MAX) data types?

7. How can I make sure that my VARCHAR column will only contain 10,000 characters? Defining it as VARCHAR(10000) generates an error of "The size (10000) given to the type 'varchar' exceeds the maximum allowed for any data type (8000)."

(...)
Comments:

When you use NVarchar(MAX)... you always can have some doubts, what does really means max? (2 Gb), is a real replacement for Text fields? (yes), ...