Maint Plan launches all jobs simultaneously

  • I suspect it's the two tasks that call existing sql agent jobs -- these two jobs ( not my creations ) use sqlcmd.exe to launch stored procedures. They seem to ignore the precedence constraints ( launch next plan task upon completion ) and subsequent jobs are launched immediately which is not desired.

    So the sqlcmd agent jobs must be returning success immediately. Perhaps changing those to just Tsql exec stored procedure with parameters would work?? I've never seen maint plan precedence contraints "fail" like this.

  • If I am reading this correctly, you have two tasks setup that are using the Execute SQL Agent Job tasks in a maintenance plan. You have placed precedence contraints between the two and are seeing that both jobs are executing at the same time.

    This is normal behaviour - because all the Execute SQL Agent Job task does is starts an agent job. Once the job is started, the task is completed and the next task can begin. So, if the agent job you are starting is going to take a few minutes or more and the next task is really dependent upon the first task - this is not going to work.

    You need to move the code into the maintenance plan and use a task to execute SQL instead.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • That makes sense Jefferey, thanks. I should be able to create tsql statements that launch these procs with parameters. Somebody else created the exists agent jobs using sqlcmd.exe,not sure why.

Viewing 3 posts - 1 through 2 (of 2 total)

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