2

I am trying to setup output log for a replication merge agent on SQL Server 2012 by specifying the following parameter at the end of the Run agent step

-Output C:\ReplOutput.txt

Now when I run the agent again it fails and shows below error

String or binary data would be truncated. [SQLSTATE 22001] (Error 8152). The step failed.

The agent runs when I remove that parameter but I need it for debugging in case there are errors in replication. Any assistance would be highly appreciated.

Bat_Programmer
  • 6,717
  • 10
  • 56
  • 67
  • 1
    I can't confirm this right now, but I would look at replication agent OS level permissions. Based on other experiences, there are occasions where logging an OS level error message can overflow an internal buffer or field length. If the agent can't write to the destination, you will generate some form of OS level error. As a test, create a directory with universal write permissions and direct the output to there. – Laughing Vergil Jul 20 '16 at 00:29
  • @LaughingVergil Ok I created a new folder and gave the agent service account full access. Now the job is working and able to output log information. Thanks a lot :) – Bat_Programmer Jul 20 '16 at 00:57

1 Answers1

1

This is almost certainly a permissions issue with an error too large for the configured logging storage. If you aren't using a custom error logging routine, you may want to call this to Microsoft's attention as a potential buffer overrun error.

Laughing Vergil
  • 3,706
  • 1
  • 14
  • 28