November 18, 2002 at 9:26 am
[000] Request to run job ABC (from User ***) refused because the job already has a pending request from User ***.
Job 'A' iteratively is supposed to launch job 'B' to email different results to different recipients. However, I keep receiving the error (above) after completing the first iteration.
I have even tried to no avail the following code to wait for the job to finish:
-------------
do {
var objSqlSrv = CreateObject("SQLDMO.SQLServer");
objSqlSrv.Connect ("xxx", "xxx", "xxx");
jobStatus = String(objSqlSrv.JobServer.Jobs("B").CurrentRunStep).substr(0,1);
objSqlSrv.Disconnect();
objSqlSrv = null;
} while ( jobStatus != '0' );
-------------
Any help will be greatly appreciated. TIA
November 19, 2002 at 6:03 am
Never done this but have you checked the code that returns jobStatus is working OK!.
IS your code running too soon? CurrentRunStep will return 0 if the job step is indeterminate or the job is idle. Maybe you can use CurrentRunStatus instead or a combination of the two.
Hope this helps.
Edited by - DavidBurrows on 12/06/2002 04:42:52 AM
Far away is close at hand in the images of elsewhere.
Anon.
December 7, 2002 at 9:24 pm
Have you checked you return on jobStatus to make sure you are getting a value back?
Also, what happens in Job A to need to have it start job B?
December 8, 2002 at 7:33 am
Are you sure your 1st job is finished before you try to run it a second time? And make sure the job is enabled.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply