Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 3.32 KB

File metadata and controls

69 lines (55 loc) · 3.32 KB

title: "SET TEXTSIZE (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "04/12/2016" ms.prod: sql ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw" ms.reviewer: "" ms.suite: "sql" ms.technology: t-sql ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords:

  • "TEXTSIZE_TSQL"
  • "TEXTSIZE"
  • "SET_TEXTSIZE_TSQL"
  • "SET TEXTSIZE" dev_langs:
  • "TSQL" helpviewer_keywords:
  • "SET TEXTSIZE statement"
  • "SELECT statement [SQL Server], text size returned"
  • "size [SQL Server], text and image data"
  • "TEXTSIZE option"
  • "text size returned [SQL Server]" ms.assetid: 787154a6-39a6-4dd6-a6d0-67b4364f95d5 caps.latest.revision: 38 author: CarlRabeler ms.author: carlrab manager: craigg monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017"

SET TEXTSIZE (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-all-md]

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

Important

ntext, text, and image data types will be removed in a future version of [!INCLUDEmsCoName][!INCLUDEssNoVersion]. 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.

Topic link icon Transact-SQL Syntax Conventions

Syntax

SET TEXTSIZE { number }   

Arguments

number
Is 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 [!INCLUDEssNoVersion] Native Client (10.0 and higher) and ODBC Driver for [!INCLUDEssNoVersion] automatically specify -1 (unlimited) when connecting.

Drivers older than [!INCLUDEssNoVersion] 2008: The [!INCLUDEssNoVersion] Native Client ODBC driver and [!INCLUDEssNoVersion] Native Client OLE DB Provider (version 9) for [!INCLUDEssNoVersion] automatically set TEXTSIZE to 2147483647 when connecting.

Remarks

Setting SET TEXTSIZE affects the @@TEXTSIZE function.

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

Permissions

Requires membership in the public role.

See Also

@@TEXTSIZE (Transact-SQL)
Data Types (Transact-SQL)
SET Statements (Transact-SQL)