I have setup a production server and a staging server. Whenever we are at the point in our release cycle where we want to begin testing on staging I want to copy the production DB over to our staging server. I have setup snapshot replication to do this and have setup the staging server to have a pull subscription to the production DB.

I want my continuous integration server to be able to kick off this process. How do I programmatically trigger a snapshot to be created and replicated?

If there is a way to trigger this process is there a way to know when it's finished?


Triggering the snapshot is easy. Simply start the snapshot agent on the distributor. When the snapshot agent stops the snapshot has been created. When it is done start the distribution agent. When it stops, the snapshot has been deployed.

  • Yes, but I would like to do this programmatically. – Chris Jun 13 '12 at 13:14
  • That would be done by using sp_start_job on the distributor within the msdb database. – mrdenny Jun 15 '12 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.