Link to home
Start Free TrialLog in
Avatar of alexmac05
alexmac05Flag for United States of America

asked on

SQL scheduled jobs - request to run job refused because the job is already running from a request by User XXXXX

I have code that executes a SPROC that executes a SQL Scheduled Job.

The problem is that the scheduled job returns an error because it is already running.

Exception: executeCommandQuery SQLServerAgent Error: Request to run job XXXXXXXXXX (from User XXXXXXXXX) refused because the job is already running from a request by User XXXXXXXX

my question, is what is the best practice for this issue?

1. Is it a best practice to handle the error codes in the SPROC and to continue trying to start the scheduled job until it runs? If so, how do you know when to give up (just set up a time-out after so much time)?

2. Is it possible to configure the SQL Scheduled job such that it queues these requests up and I perhaps don't have this configured properly?

3. Is the best way to handle this in the code, such that I try a few times to start the sproc again and then have it time-out?
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial