Getting error when running a SQL agent job from stored proc.. Help needed

  • When running the job from stored proc I am getting the below error ..Can some one help me on that.

    Request to run job (from User 'abc') refused because the job already has a pending request from User 'abc'.

    IF NOT EXISTS(select * from msdb..sysjobhistory where job_id='9DDEWE' and run_status=4 )

    BEGIN

    exec sp_start_job @job_name = 'TEST'

    END

    Thanks,
    Chinna

    Its the Journey which gives you Happiness not the Destination-- Dan Millman

  • Does the job has multiple steps?

    If Yes, you should have triggered the job using Activity monitor and its waiting for response to submit your response for start at step. In the mean time you would have fired the query to run the job.

  • Make sure the job_id in the select correspondents with the job_name in the start command. That's a mistake I have made in the past 😉

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

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

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