Sql-server – How tosolate A Merge Replication Timeout

merge-replicationreplicationsql server

I am using merge replication in SQL 2012 with web sync.

When I create my subscription I am getting a timeout. The error message is not clear about cause of the timeout, but what I do know is if I increase the QueryTimeout parameter on the merge agent from default of 300 to 1200 it works.

How can I find the SQL that is timing out? I have used SQL profiler, but it isn't clear which query is timing out. In SQL profiler I selected the option 'Attention' under 'Errors and Warnings', but didn't see anything about a timeout.

Best Answer

Add the Merge Agent parameters -OutputVerboseLevel 4 -Output C:\TEMP\mergeagent.log to the Run Agent Merge Agent job step to find out where it is timing out.