when insert length of lob data to be replicated ex

2020-06-17 05:31发布

问题:

I am trying to insert a value into a column of datatype image in SQL Server. I am getting the following error:

Length of LOB data (70823) to be replicated exceeds configured maximum 65536.  
The statement has been terminated.

The data length is less than 2 MB.

What is the problem?

回答1:

For SQL Server 2005 or earlier you can run:

sp_configure 'max text repl size', 2147483647

For SQL Server 2008 or later you can run:

sp_configure 'max text repl size', -1

The former increases the maximum size allowed, the latter essentially says "remove the limit". Once the maximum size is increased or removed, large LOBs will be able to be replicated.



回答2:

Don't forget to run RECONFIGURE after running sp_configure so that your changes can take effect



回答3:

As an alternative, you can configure the max text replication size option via SQL Server Management Studio

Reference: http://msdn.microsoft.com/en-us/library/ms179573.aspx

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.

I've tested it in SQL Server 2012, but from the previous link you can view the instructions for 2005 and 2008 which are the same.