You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
29
-
30
-
> [!IMPORTANT]
31
-
> **ntext**, **text**, and **image** data types will be removed in a future version of [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. 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.
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.
31
+
32
+
> [!IMPORTANT]
33
+
> **ntext**, **text**, and **image** data types will be removed in a future version of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. 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.
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.
44
-
45
-
The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client (10.0 and higher) and ODBC Driver for [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] automatically specify `-1` (unlimited) when connecting.
46
-
47
-
**Drivers older than [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] 2008:** The [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client ODBC driver and [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Native Client OLE DB Provider (version 9) for [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] automatically set TEXTSIZE to 2147483647 when connecting.
48
-
49
-
## Remarks
50
-
Setting SET TEXTSIZE affects the @@TEXTSIZE function.
51
-
52
-
The setting of set TEXTSIZE is set at execute or run time and not at parse time.
53
-
54
-
### Impacts on `sp_executesql` and `EXECUTE` Statements
55
-
The `TEXTSIZE` setting affects the result of dynamic statements executed by [sp_executesql (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-executesql-transact-sql.md) or [EXECUTE (Transact-SQL)](../../t-sql/language-elements/execute-transact-sql.md), especially when the result is inserted into a table.
Note that regardless of the target table's correct data type, SQL truncates the text before insertion due to the `TEXTSIZE` setting. When using SQL Server Agent Jobs that runs `EXEC` or `sp_executesql`, you must be cautious. SQL Server Agent modifies the default value of `TEXTSIZE`, which could lead to unexpected behavior. For example, queries may work fine in SQL Server Management Studio but fail when executed through SQL Agent, especially when working with certain text columns that exceed the size. To prevent this issue, ensure you add `SET TEXTSIZE` to the query that the job runs, explicitly defining the desired text size to avoid truncation
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.
48
+
49
+
The [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] Native Client (10.0 and higher) and ODBC Driver for [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] automatically specify `-1` (unlimited) when connecting.
50
+
51
+
## Remarks
52
+
53
+
Setting `SET TEXTSIZE` affects the `@@TEXTSIZE` function.
54
+
55
+
The setting of set `TEXTSIZE` is set at execute or run time and not at parse time.
56
+
57
+
For more information, see [Manage Transact-SQL job steps](/ssms/agent/manage-job-steps#transact-sql-job-steps).
0 commit comments