設定 max text repl size 伺服器組態選項Configure the max text repl size Server Configuration Option

適用於: 是SQL Server 是Azure SQL Database (僅限受控執行個體) 否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 陳述式中,可以加入複寫資料行或擷取資料行中的 textntextvarchar(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.

安全性Security

權限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. 系統管理員 (sysadmin)serveradmin 固定伺服器角色會隱含 ALTER SETTINGS 權限。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 EngineDatabase EngineConnect to the Database EngineDatabase 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)