4

I recently ran into an issue with where an application tried to do an insert with data over the max text repl size. this time the failed insert was captured by the application log, and I was made aware. I was a little disturbed though to find out the error wasn't captured in the sql server error log, and I don't see it captured any place else.

Any advise on how to capture, and Ideally generate alerts based on the 'Length of LOB data (XXXXXX) to be replicated exceeds configured maximum " would be appreciated.

4

The SQL Server error log only captures errors having a significant severity (generally 19-25, with exceptions). See the documentation here:

Imagine if all divide by zero, ambiguous column, or syntax errors flooded the error log? That log would quickly become an unmanageable mess.

What you can do is use an Alert, which can trigger notifications and other actions whenever an exception with a certain severity (or, in your case, error number) is raised:

For example:

EXEC sys.sp_add_alert @name = 'repl size error',
  @message_id = 7139, -- I believe this is the right message
  ...

See this doc for sp_add_alert usage:

2
  • Thanks, I didn't capture the message number and I wasn't finding a specific message number when looking online. Thanks a lot – Patrick Aug 16 '19 at 17:36
  • @Patrick FWIW I don't have it memorized either, I found it by something along the lines of SELECT * FROM sys.messages WHERE [text] LIKE N'%repl%size%'; – Aaron Bertrand Aug 16 '19 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.