Quick one today:
Every once in a while, this error pops up in production environments, usually after application software upgrade. Error message looks something like this:
Length of LOB data (65536) to be replicated exceeds configured maximum 131072. The statement has been terminated.
Essentially, what happened is that the size of LOB data that is being replicated has exceeded the upper limit settings. So Sql Server is complaining that in encountered sizes larger than what is is configured to replicate. There is an easy fix.
-- -- Increase the maximum size of text to replicate -- EXEC sys.sp_configure N'max text repl size (B)', N'150000' GO RECONFIGURE WITH OVERRIDE GO
max text repl size (B) indicates the maximum size in bytes that could be replicated in a single statement like INSERT UPDATE, etc.
For example, in our situation, we have a table with XML column. If the size of the XML file goes beyond the default size of 65536 bytes, this error occurs when that record is replicated.
As it is, XML columns can accept XML files larger than 65536 bytes during INSERT, UPDATE, etc; But when this row (new INSERT or UPDATE) needs to be replicated to Subscriber, the replication infrastructure may not be able to handle it as the upper limit was configured to 65536 bytes. As we saw above, it is easy to change.
Hope this helps,
_Sqltimes