Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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