Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Getting error when running a SQL agent job from stored proc.. Help needed Expand / Collapse
Author
Message
Posted Wednesday, August 14, 2013 7:10 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, November 12, 2014 9:07 PM
Points: 388, Visits: 2,370
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
Post #1484554
Posted Thursday, August 15, 2013 4:58 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 5:55 AM
Points: 38, Visits: 447
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.
Post #1484685
Posted Thursday, August 15, 2013 5:02 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 5:56 AM
Points: 2,439, Visits: 2,976
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’! **
Post #1484687
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse