Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-08-20 : 16:08:13
|
Does anyone know of a way to start a job in a script and wait for it to complete before executing the next command:1. Run job 1 and wait for it complete.2. Then, run job 2 and wait for it complete.3. Then, run job 3 and wait for it complete.etc.CODO ERGO SUM |
|
X002548
Not Just a Number
15586 Posts |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-08-20 : 17:02:28
|
quote: Originally posted by X002548...But if you just schedule the jobs with many steps, won't they wait until they complete?...
I wanted to setup an individual job for each step to make it easy to rerun individual steps, but would like to be able to run each individual job as a step of another job.An alternative solution would be a way to start a job at an individual step, and run only that step when I do a rerun.CODO ERGO SUM |
 |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-20 : 17:22:24
|
You can query sysjobhistory to see if the job completed. SQL Server adds a record to this table when a job/step finishes execution.The run_status should have an appropriate value.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
|
|