Nested sql agent jobs?

  • Problem: Need to execute 8 stored procs in parallel. Can not use SSIS.

    solution: Create 8 jobs on SQL agent, and execute 8 jobs in parallel. These will be scheduled on demand.

    New problem: Can i create another agent job that will execute all 8 agent jobs in parallel, so my scheduling is restricted to this one job?

    Can one job call 8 stored procedures in parallel?

  • that's a shame, a package could easily call your eight parallel processes.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • when you say "package" are you referring to SSIS or is there some other package in SQL server?

    thanks!

  • Yes, I'm refering to SSIS packages.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • You can create one job that calls msdb.sp_start_job 8 times. This procedure returns control when the job starts, so all 8 jobs will run at the same time and your main job will return immediately.

    You could start all 8 jobs in one step and then have a second step that checks the status of each of the 8 jobs and waits until they all complete - just in case you wanted the single main job to wait.

Viewing 5 posts - 1 through 4 (of 4 total)

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