Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

SQL Agent Job Chaining

It would be a great feature to make SQL Agent Jobs hierarchical so that one (or more) job(s) can be dependent on another job allowing SQL Agent Jobs to be chained together.

71 votes
Sign in
(thinking…)
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

4 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...
  • Al Howarth commented  ·   ·  Flag as inappropriate

    OP, Are you requesting dependencies?
    IE, Job1, Job2 and Job3 can run anytime during the day. Job4 will start when all three are done?

    Just want to be sure what you are asking, so I can vote, or create my own suggestion if I'm misunderstanding. We looked at AutoSys and its dependencies feature is we want to replicate in SQL Agent.

  • John G Hohengarten commented  ·   ·  Flag as inappropriate

    I think this could be implemented if Microsoft adds a new SQL Agent Job Step type of `SQL Server Agent Job` (along with the rest of the others like ActiveX Script, Operating system (CmdExec), etc.) found under the "Type" dropdown in New Job Step window. (via right click New Job).

  • Michelle commented  ·   ·  Flag as inappropriate

    Yeah, we use sp_start_job to start other jobs in a lot of scenarios. It's fairly straight-forward as long as you have the right security in place. We even start jobs on different servers.

  • Nobody commented  ·   ·  Flag as inappropriate

    Easy enough. T-SQL jobstep using exec msdb.dbo.sp_start_job, potentially dependent on some select from msdb.dbo.sysjobhistory.

Feedback and Knowledge Base