Troubleshooting Guide: Error 7139 – LOB Data Exceeds Configured Maximum (SQL Server 2025)
Why This Error Happens
This error occurs when SQL Server’s replication engine attempts to process a Large Object (LOB) data value—such as text, ntext, image, varchar(max), or nvarchar(max)—that exceeds the size limit defined by the max text repl size configuration option. By default, this setting is capped at 65536 bytes, and any transaction containing LOB data larger than this threshold will fail replication or Change Data Capture (CDC) processing. This is a configuration constraint rather than a corruption issue, and it commonly surfaces after migrating databases with large documents or BLOBs into a replicated topology.
Step-by-Step Resolution Guide
Step 1: Verify the Current Configuration Value
- Open SQL Server Management Studio (SSMS) or a query window connected to the Publisher instance.
- Run the following command to check the current setting:
EXEC sp_configure 'max text repl size';
- Note the
run_valueandconfig_valuecolumns; if they are set to the default (65536), this confirms the root cause.
Step 2: Increase the Max Text Repl Size Value
- Execute the following T-SQL script to raise the limit (example sets it to 2 GB using -1, or specify a byte value):
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
EXEC sp_configure 'max text repl size', -1; -- -1 allows unlimited size up to 2GB
RECONFIGURE;
GO
- Alternatively, specify a precise byte limit (e.g., 104857600 for 100MB) instead of -1 if unlimited size is a security concern.
Step 3: Restart the SQL Server Service
- On Windows Server 2025 or Windows 11, open SQL Server Configuration Manager.
- Navigate to SQL Server Services, right-click your instance (e.g., MSSQLSERVER), and select Restart.
- Note: While
RECONFIGUREoften applies this setting dynamically, a service restart ensures the Log Reader Agent and Distribution Agent fully refresh their cached configuration values.
Step 4: Restart the Replication Agents
- Open the Replication Monitor in SSMS.
- Locate the specific Publication throwing the error and right-click the Log Reader Agent or Distribution Agent.
- Select Start Agent to force it to re-read the newly configured
max text repl sizevalue and retry the failed transaction.
Alternative or Verification Steps
- Verification: Re-run
EXEC sp_configure 'max text repl size';and confirm thatrun_valuenow matches your new setting (e.g., -1 or your specified byte limit) without requiring a server reboot. - Alternative Fix: If the error persists on the Subscriber side specifically, ensure the setting is applied identically on both the Publisher and Distributor instances, as replication requires consistent configuration across all nodes in the topology.