• I got this error in a proc where I was creating 73 jobs in a tight loop. I'd create the job, add a job server, add a job step and then start the job. I added a WAITFOR DELAY of 1/2 sec before and after the start job call and that didn't help. Then I noticed that I was making the sp_* SQL Agent proc calls within a user-defined transaction. I removed the transaction and the errors went away. Apparently, you can't create jobs\job steps and start them in a transaction. Before removing the tran, I'd cut the number of jobs in the loop down to 40 and that worked even with a transaction. But it failed with 73 jobs.

    So, don't make a lot of these SQL Agent proc calls within a user-defined transaction.

    HTH.

    -Mike Whiting