SQL Server Specification Limits – Maximum size allowed for STRING Data Types

By Santhosh N

This explains the maximum size of the STRING Data type Columns’ value allowed by the SQL Server.

Like any language or to be more specific on Data types, there is always upper limit of the size that it is allowed and SQL Server is no exception in terms of maximum size that is allowed for the following Data Types.

Data Type Length in Bytes Characters Allowed
SHORT STRING 8,000 8,000
VARCHAR 2^31-1 (2,147,483,647) 2,147,483,647
VARBINARY 2^31-1 (2,147,483,647) 2,147,483,647
XML 2^31-1 (2,147,483,647) 2,147,483,647
TEXT 2^31-1 (2,147,483,647) 2,147,483,647
IMAGE 2^31-1 (2,147,483,647)
NTEXT 2^31-1 (2,147,483,647) 1,073,741,822
NVARCHAR 2^31-1 (2,147,483,647) 1,073,741,822


Note: This hold common for both 32-bit and 64-bit SQL Server.

Related FAQs

This describes the usage of DBCC SHOW_STATISTICS command which is used for performance tuning in the Sql Server.
This explains the advanced query tuning concepts of the SQL Server in terms of using joins
This explains the various precautions needs to be taken care while indexing and choosing what columns needs to be indexed for better performance.
This explains how (in which order) the SQL Server stores the records in the table.
This explains where to have a loop if at all required to have one to get the desired result from the database.
This explains the performance overhead of using NULL values in the columns of the Database table.
SQL Server Specification Limits – Maximum size allowed for STRING Data Types  (1135 Views)