How to find SQL Server Replication related jobs and T-SQL statements


Verbose log is heavily used  in replication troubleshooting. You need to find the right job to enable to verbose log. However, it’s not easy to find the  jobs when you have hundreds replication jobs in one server.

 

 

Here is how:

1.Distribution agent

Following queries list all the distribution agent jobs, including push subscriptions and pull subscriptions. (You may need add more clause to customize your queries). By default, the SQL Server agent job names equal to the agent names for push subscription, unless you explicitly modify the job names.

use distribution—in distributor server

if not exists(select 1 from