December 13, 2010 at 12:47 am
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
December 13, 2010 at 3:47 am
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
December 13, 2010 at 6:35 am
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'
December 13, 2010 at 7:23 am
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
September 28, 2012 at 10:14 am
Hi even I am facing similar issues but the job wont start for me. Any workaround
September 28, 2012 at 10:38 am
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