Export (0) Print
Expand All
Expand Minimize

SET TEXTSIZE (Transact-SQL)

Specifies the size of varchar(max), nvarchar(max), varbinary(max), text, ntext, and image data returned by a SELECT statement.

ms186238.note(en-US,SQL.90).gifImportant:
ntext, text, and image data types will be removed in a future version of Microsoft 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. For more information, see Using Large-Value Data Types.

Topic link icon Transact-SQL Syntax Conventions


SET TEXTSIZE { number } 

number

Is the length of varchar(max), nvarchar(max), varbinary(max), text, ntext, or image data, in bytes. number is an integer and the maximum setting for SET TEXTSIZE is 2 gigabytes (GB), specified in bytes. A setting of 0 resets the size to the default (4 KB).

Setting SET TEXTSIZE affects the @@TEXTSIZE function.

The SQL Native Client ODBC driver and SQL Native Client OLE DB Provider for SQL Server automatically set TEXTSIZE to 2147483647 when connecting.

The setting of set TEXTSIZE is set at execute or run time and not at parse time.

Requires membership in the public role.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft