Please anybody suggest me how to write a script which compares the jobs on the primary and the secondary server.
Red-Gate SQL Compare will compare and script all (or at least most?) objects between two SQL Servers.
They also offer an API that lets you write .NET code to programatically compare and sync objects.
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
4 years ago