Replicating Jobs Between SQL Instances – Categories

By Greg No comments

Conceptually, replicating jobs between servers is straight forward. There are 2 things to do: If the job doesn’t exist, create it; and If the job exists, check that it’s the same, and if not, update it We don’t have a requirement to delete extra jobs, but that would add a simple third step. The problem with SQL Jobs […]

Replicating Jobs Between SQL Instances – The Setup

By Greg No comments

After deciding to replicate SQL Agent Jobs between SQL Instances using a SQL Agent job, there were a few things to setup and test. We need a way to check if the server is the primary in the AlwaysOn Availability Group, so that jobs can decide if they need to run; We needed a way […]

Replicating Jobs Between SQL Instances

By Greg No comments

We use SQL AAG’s at work for our production databases. There are 3 servers in the AAG, 2 in synchronous replication, one in Async. We have a number of SQL Jobs that need to run, usually just on the primary replica, but occasionally on the other replica’s. We also want to be able to failover the […]