Start the Snapshot agent by using SQL query command

  • Hi friends,

    Anybody has idea to start the snapshot agent by using sql query command instead of manually start it?

    Thanks a lot...

    Jenney

  • Jenney,

    It's been a while since I have done work with replication.  However, I recall that the snapshot agent is simply a job.  So, you should be add to run the job using the sp_start_job stored procedure.

     

  • Hi Rookie,

    Thanks  a lot for your feedback... Really appreciatia that. I will try your solution. Anyway i solved that problem using below script and it works

    use master 

    exec xp_cmdshell '"c:\Program Files\Microsoft SQL Server\80\COM\SNAPSHOT.EXE"  -Distributor DisName -DistributorSecurityMode 0  -DistributorLogin DisLogin -DistributorPassword DisPass -Publisher PubName -PublisherSecurityMode 0 -PublisherLogin PubLogin -PublisherPassword PubPass -PublisherDB PubDB -Publication Pub -ReplicationType 1'  

    ReplicationType = 1 for transactional replication,  2 for merge replication

    Thanks

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply