max text repl size (B)
Largest LOB value one INSERT, UPDATE, WRITETEXT or UPDATETEXT may write to a replicated or CDC-captured column.
- Default
65536 bytes- Range
- -1, or 0 to 2147483647 bytes
- Restart needed
- No
- Default checked on
- SQL Server 2025
What it does
It applies to transactional replication and CDC, and snapshot and merge replication ignore it. text, ntext, image, varchar(max), nvarchar(max), varbinary(max), json, xml and similar columns all fall under it. Go past the limit and the statement fails with error 7139 instead of replicating a truncated value.
Default value
65536 bytes. 65536 (SQL Server 2025). A value of -1 removes the limit, leaving only the data type's own.
Check the current value
SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced FROM sys.configurations WHERE name = 'max text repl size (B)'; -- EXEC sp_configure 'max text repl size (B)'; also works, but only while show advanced options is 1; -- otherwise it fails with Msg 15123 because this is an advanced option.
Change it
EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'max text repl size (B)', -1; RECONFIGURE;
No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.
When to change it
When replication or CDC fails with error 7139 on a table whose rows carry large documents. Raising it is the point fix; dropping the LOB columns from the publication or capture list is the structural one.
What can go wrong
Raising it lets one statement push a whole large document into the distribution database and onto every subscriber in one go, and log reader latency spikes return in a bigger shape. The same value governs CDC capture on the instance, and neither snapshot nor merge replication reads this option at all, so a fix tuned for one path says nothing about the others.
Questions about max text repl size (B)
What is the default value of max text repl size (B) in SQL Server?
65536 bytes. 65536 (SQL Server 2025). A value of -1 removes the limit, leaving only the data type's own.
Does changing max text repl size (B) require a restart?
No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.
When should I change max text repl size (B)?
When replication or CDC fails with error 7139 on a table whose rows carry large documents. Raising it is the point fix; dropping the LOB columns from the publication or capture list is the structural one.
Back to all SQL Server settings, or check the SQL Server manual for every option.
Check max text repl size (B) on your own server
SQLly runs the query above against SQL Server and the other engines in this reference, from one desktop app on macOS, Windows and Linux.
Text and data on this page: CC BY 4.0, credit SQLly (sqlly.app). Code and SQL snippets: MIT. License details View as Markdown