0

Getting the following error message on the Sql Server Error Log:

SQLServer Error: 599, WRITE: The length of the result exceeds the length limit (2GB) of the target large type. [SQLSTATE 42000] (LogToTableWrite)

enter image description here

How can I find what job is causing this?

1
  • 1
    are you trying to pull more than 2GB of data into (N)VARCHAR(MAX)? Error Log doesn't tell you what is causing the error, nor which sys. table is being affected. Only way to find the offending jobs is to run a trace on msdb.
    – CR241
    Commented Jul 26, 2018 at 23:10

1 Answer 1

2

While I can tell you that in my case, I found the job causing the error by it's frequency, (the error was happening every five minutes) and there were only 2 jobs running every 5 minutes. However, after knowing which job was causing the error, I spent a lot of time to determine why the error was happening, given that the job itself was not failing.

Turns out that in the SQL Server Agent, Job Activity Monitor, Job Properties, Steps, (Edit), Advanced tab, someone checked the option: "Append output to existing entry in table", which caused that the output continued to grow over time, resulting in the error: "length of the result exceeds the > length limit (2GB) of the target large type". Unchecking the option circled below solved the issue for me.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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