running jobs

  • Hi all,

     We have 2 merge replication jobs. I want to complete one job and then start another job after the first one is completed. Is there any way, that I can make the first job to trigger the second job as soon as it is over?

    Thanks in advance.

    Thanks,

    Preeth.

  • Hi,

    Do not schedule the job u wanted to run after the first job.

    U can check sysjobs and get the job id which is running as it will complete the success or failiure information will be entered in sysjobservers.

    u can query sysjobserver with the job id which is running and check if the last_run_outcome status is 1 then the job is successful if 0 then it is a failure.

    if job success then u can run other job.

     

    exec msdb..sp_start_job @job_id = '59F7EAA1-7E8A-43F7-BA86-17F05BADD1A1'

    HTH

    from

    Killer

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

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