I have a schedule that does something daily, every two hours in a time interval. I want to set an end date for this schedule, but I'm wondering if it is inclusive or exclusive. In other words, if I set the end date at march 26, will today be the last day it runs, or tomorrow (it is march 25 today).
Schedulers in SQL Server DMVs Windows uses a preemptive scheduling mechanism and assigns a quantum of CPU time to every thread, when a thread consumes its quantum it is sent to a queue and other threads are granted execution.
To change the scheduling details for a job definition Click the plus sign to expand SQL Server Agent. Click the plus sign to expand the Jobs folder. Right-click the job whose schedule you want to edit and select Properties. In the Job Properties -job_name dialog box, under Select a page, select Schedules.
Expand SQL Server Agent, expand Jobs, right-click the job you want to schedule, and click Properties. Select the Schedules page, and then click New. In the Name box, type a name for the new schedule. Clear the Enabled check box if you do not want the schedule to take effect immediately following its creation.
EVENTS table, so you can run "SELECT * FROM INFORMATION_SCHEMA. EVENTS" to see the list of scheduled jobs and information about them.
If you look in the msdb database, using the sysschedules_localserver_view view, then you can see the schedule along with an end date (active_end_date = March 26) and an end time (active _end_time) which will most likely be 235959, meaning that any job scheduled with an end date of March 26 will run on March 26, and the first day "missed" will be the 27th. I can confirm this from bitter experience that with an end date set in the Job - Schedules dialog, the job will run on that date. So the end date is Inclusive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With