SQLServerAgent Error: Request to run job "jobname" (from User xxxx\aaaa) refused because the job already has a pending request from User XXXX\AAAA

  • Hi All,

    I am getting following error when my SQL agent starts running job as per schedule.

    SQLServerAgent Error: Request to run job "jobname" (from User xxxx\aaaa) refused because the job already has a pending request from User XXXX\AAAA.

    I am calling the Job in my procedure.

    How to overcome this and exucute succeddfully as per schedule.

    when i check the Job status it showed Idle.

    I used sp_stop_job before running the job -> then it gave the job was in idle state.

    PLease help me how to resolve this one.

    Thanks,

    Sasidhar P

  • Hi Sasidhar,

    I was not able to reproduce that issue. Can you please post the code and the job step details?

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Hi,

    The following code has been Used in a script which will run continuosly During day.The SSISPackage is a job which already existing package on SQL server.

    It will stopped by itselef by checking date changed to next day or not, which was first step of the script.

    Main:

    Date Checking Process

    Date was Same

    Goto Continue

    Date Was changed

    GOTO ExitS

    Continue:

    Select @SSISStepID=job_id from msdb..sysjobs where name='SSISPAckage'

    Exec msdb..sp_start_job 'SSISPAckage'

    SSISStepLoop:

    Exec getJobStatus @job_id=@SSISStepID ,@StatusID= @J_SSIS_Status output

    PRINT 'SSISPAckage '

    IF @J_SSIS_Status=1

    BEGIN

    GOTO SSISStepLoop

    END

    ELSE

    BEGIN

    GOTO SKIPSSIS

    END

    SKIPSSIS:

    Insert into XYZ

    EXEC ABD.dbo.testSP

    -----

    ----

    ---

    GOTO MainLoop

    ExitS:

    Print 'End'

  • I was able to overcome that by checking the job status before starting it.

    select @J_SSIS_Status=run_status from sysjobhistory where job_id=@SSISStepID

    and run_status=4

    print @J_SSIS_Status

    if @J_SSIS_Status <>4

    begin

    Exec msdb..sp_start_job 'sptest'

    end

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Hi even I am facing similar issues but the job wont start for me. Any workaround

  • You might want to make sure you are writing execution trace history to SQL Server Agent. This can give you some additional logging for troubleshooting purposes. Do this in SQL Agent properties and set it to "include job execution trace history".

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

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