Events
Sep 15, 6 AM - Sep 17, 3 PM
The best SQL community-led learning event. Sept 2025. Save €200 with code FABLEARN.
Get registeredThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Azure Synapse Analytics
Analytics Platform System (PDW)
Specifies the size, in bytes, of varchar(max), nvarchar(max), varbinary(max), text, ntext, and image data returned to the client by a SELECT
statement.
Important
ntext, text, and image data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.
Transact-SQL syntax conventions
SET TEXTSIZE { number }
The length of varchar(max), nvarchar(max), varbinary(max), text, ntext, or image data, in bytes. number is an integer with a maximum value of 2147483647
(2 GB). A value of -1
indicates unlimited size. A value of 0
resets the size to the default value of 4 KB.
The SQL Server Native Client (10.0 and higher) and ODBC Driver for SQL Server automatically specify -1
(unlimited) when connecting.
Setting SET TEXTSIZE
affects the @@TEXTSIZE
function.
The setting of set TEXTSIZE
is set at execute or run time and not at parse time.
For more information, see Manage Transact-SQL job steps.
Requires membership in the public role.
Events
Sep 15, 6 AM - Sep 17, 3 PM
The best SQL community-led learning event. Sept 2025. Save €200 with code FABLEARN.
Get registeredAsk Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in