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

SQL Agent Recurring Schedule End Event Expand / Collapse
Author
Message
Posted Monday, February 11, 2013 4:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 24, 2013 10:22 AM
Points: 2, Visits: 63
What actually causes a SQL Agent job to run for the last time within the daily frequency settings?

I ask this because I have a daily job that does not always start. It is scheduled to run daily starting at 3:30 PM, repeat every 6 hrs, ending at 10:00 AM. That was intended to cause four executions during an 18 hour period (3:30 PM, 9:30 PM, 3:30 AM and 9:30 AM). Start time of 3:30 PM was selected because it is before SOD at the most Eastern site.

I have stopped that job and replaced it today with a similar job staring at 3:30 AM and ending at 10:00 PM, to see if midnight crossing is a problem. However, I have several other jobs that cross midnight without a problem and am wondering if the issue is interference between starting at, occurs every and ending at arguments.

The one difference I see with the job that does not always start is the daily starting time and the first repetition past the ending time are the same. I am wondering if reoccurrences do not end until the first repetition time after the ending time.

If I continue to experience missed starts, my next attempt will be to change the occurrence to ever 5 hrs and 45 minutes. That will provide a one hour gap between the first occurrence following ending time and the next start time.
Post #1418316
Posted Thursday, February 14, 2013 1:33 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, June 28, 2014 2:49 PM
Points: 116, Visits: 346
AFAIK if the job is already running, it will not start again. If you need this behaviour you have to write a service on your own.

Greetz
SQL Pizza



sometimes you dont see the pizza for the toppings...
seek and ya shall find...
Post #1419863
Posted Thursday, February 14, 2013 5:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 24, 2013 10:22 AM
Points: 2, Visits: 63
Yes, I know a job won't start when it is already running. That is why I asked “when does a SQL Agent job with multiple occurrences end”.

The single job I constructed should have worked, provided SQL Agent detected the fourth occurrence should be the last and ended the job at that point in time. My guess is that the job does not end until the first occurrence after the ending time.

On 2/12, I replaced the original job with two jobs, one AM and one PM job. These jobs have worked so far and I think will solve the problem.
Post #1420009
Posted Thursday, February 14, 2013 7:22 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, July 7, 2014 9:40 AM
Points: 279, Visits: 91
cant you just simply create 2 schedules, 1 for the PM hours and 2nd for the AM hours. each one of them can have its own occurs overy 'x' hours, starting and its time and ending at another time.
Post #1420052
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse