June 15, 2004 at 8:55 am
Can a job schedule another job within sqlserver? I know I can add multiple steps and have multiple DTS packages within the job, but I am trying to avoid having many steps within one job and categorize certain jobs. Thanks.
June 15, 2004 at 10:28 am
You could run an sp_startjob as a TSQL step within the DTS, however it's not going to wait until the other job has completed before it goes on to the next step.
June 15, 2004 at 1:08 pm
Script the job (right click, all tasks, generate sql script), then pull the code out that creates the schedule. Insert that code into your job. Use sp_add_jobschedule to add a new schedule or sp_update_jobschedule to change an existing schedule. BOL has documentation for the 2 procedures.
Steve
June 16, 2004 at 8:23 am
Even simpler - take Nicholas' suggestion (sp_start_job) and insert it into your scheduled job, ie, NOT your DTS package. You will then have a step dependency. Your first job needs to complete its job steps before it reached your newly inserted final job step (unless you choose otherwise).
Steve
June 16, 2004 at 11:54 am
Thanks for the suggestions. I tried Steve's suggestion and it works great!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply