views:

181

answers:

1

Hi,
How can we find the job dependency in SQL server.
Therotically basing on the success of first one job the other job begins.

Thanks a lot in advance!!

+1  A: 

Typically you do this with job steps, not individual jobs. However, I guess if you really wanted these as separate jobs, you could this:

Create job A:

step 1 - do stuff  
step 2 - call job B using sp_start_job

under advanced for step 1:

  on success, go to step 2
  on failure, quit the job with failure, notify, what have you

Basically, the only way you call job B is if job A's 1st step succeeds.

Aaron Bertrand