starting snapshot agent with replication script

  • hi

    sometimes we use replication scripts to create replications

    anyway after runing the scripts , we cant get the snapshot agent to start automatically, we always have to start it using the managment studio or the entrprise manager.

    any one can help us here? hwo to get that job run with the script within the execution of those replication scripts

     


    If something's hard to do, then it's not worth doing.

  • These are the steps:

    1. EXEC sp_MSenum_replication_agents @type = 1

    from there extract snapshot Job name that belongs to the publisher_db you are interested

    2. EXEC msdb.dbo.sp_start_job @job_name = @SnapshotJobName -- this is the name from previous step

    good luck


    * Noel

  • thanks noel for your help

    but i couldnt manage to get the snapshot job name from

    EXEC sp_MSenum_replication_agents @type = 1

    i tried to insert the result in a temp table but i got an error

    so please any help on how to extract the jobname?

     

    another question does this method works on sql server 2000 as well?

    thanks in advance 


    If something's hard to do, then it's not worth doing.

  • just use client code to get the results from the stored procedure or use OPENROWSET.

     

     


    * Noel

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

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