配置 max text repl size 服务器配置选项Configure the max text repl size Server Configuration Option

适用对象: 是SQL Server 是Azure SQL 数据库(仅限托管实例)否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server yesAzure SQL Database (Managed Instance only) noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

本主题说明如何使用 SQL ServerSQL Server 中配置 SQL Server Management StudioSQL Server Management Studio max text repl size Transact-SQLTransact-SQL服务器配置选项。This topic describes how to configure the max text repl size server configuration option in SQL ServerSQL Server by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL. max text repl size 选项指定使用单个 INSERT、UPDATE、WRITETEXT 或 UPDATETEXT 语句可以向已复制列或已捕获列添加的 text****ntext****varchar(max)****nvarchar(max)****varbinary(max)****xmlimage 数据的最大大小(以字节为单位)。The max text repl size option specifies the maximum size (in bytes) of text, ntext, varchar(max), nvarchar(max), varbinary(max), xml, and image data that can be added to a replicated column or captured column in a single INSERT, UPDATE, WRITETEXT, or UPDATETEXT statement. 默认值为 65536 个字节。The default value is 65536 bytes. 值为 -1 表示除了数据类型指定的限制之外,没有大小限制。A value of -1 indicates that there is no size limit, other than the limit imposed by the data type.

本主题内容In This Topic

开始之前Before You Begin

限制和局限Limitations and Restrictions

  • 此选项适用于事务复制和变更数据捕获。This option applies to transactional replication and Change Data Capture. 当将服务器配置为具有事务复制功能和变更数据捕获功能时,指定的值将适用于这两项功能。When a server is configured for both transactional replication and Change Data Capture, the specified value applies to both features. 快照复制和合并复制将会忽略此选项。This option is ignored by snapshot replication and merge replication.

SecuritySecurity

权限Permissions

默认情况下,所有用户都具备不带参数或仅带第一个参数的 sp_configure 的执行权限。Execute permissions on sp_configure with no parameters or with only the first parameter are granted to all users by default. 若要执行带两个参数的 sp_configure 以更改配置选项或运行 RECONFIGURE 语句,则用户必须具备 ALTER SETTINGS 服务器级别的权限。To execute sp_configure with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. ALTER SETTINGS 权限由 sysadminserveradmin 固定服务器角色隐式持有。The ALTER SETTINGS permission is implicitly held by the sysadmin and serveradmin fixed server roles.

使用 SQL Server Management StudioUsing SQL Server Management Studio

配置 max text repl size 选项To configure the max text repl size option

  1. 在对象资源管理器中,右键单击服务器并选择 “属性”In Object Explorer, right-click a server and select Properties.

  2. 单击 “高级” 节点。Click the Advanced node.

  3. “杂项” 下,将 “最大文本复制大小” 选项更改为所需的值。Under Miscellaneous, change the Max Text Replication Size option to the desired value.

使用 Transact-SQLUsing Transact-SQL

配置 max text repl size 选项To configure the max text repl size option

  1. 连接到 数据库引擎Database EngineConnect to the 数据库引擎Database Engine.

  2. 在标准菜单栏上,单击 “新建查询”From the Standard bar, click New Query.

  3. 将以下示例复制并粘贴到查询窗口中,然后单击“执行” 。Copy and paste the following example into the query window and click Execute. 此示例说明如何使用 sp_configuremax text repl size 选项的值配置为 -1This example shows how to use sp_configure to configure the max text repl size option to -1.

USE AdventureWorks2012 ;  
GO  
EXEC sp_configure 'show advanced options', 1 ;   
RECONFIGURE ;   
GO  
EXEC sp_configure 'max text repl size', -1 ;   
GO  
RECONFIGURE;   
GO  
  

有关详细信息,请参阅 服务器配置选项 (SQL Server)版本的组合自动配置的最大工作线程数。For more information, see Server Configuration Options (SQL Server).

跟进:在配置 max text repl size 选项之后Follow Up: After you configure the max text repl size option

该设置将立即生效,无需重新启动服务器。The setting takes effect immediately without restarting the server.

另请参阅See Also

SQL Server 复制 SQL Server Replication
INSERT (Transact-SQL) INSERT (Transact-SQL)
RECONFIGURE (Transact-SQL) RECONFIGURE (Transact-SQL)
服务器配置选项 (SQL Server) Server Configuration Options (SQL Server)
sp_configure (Transact-SQL) sp_configure (Transact-SQL)
UPDATE (Transact-SQL) UPDATE (Transact-SQL)
UPDATETEXT (Transact-SQL) UPDATETEXT (Transact-SQL)
WRITETEXT (Transact-SQL)WRITETEXT (Transact-SQL)