Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Query to predict future job schedules from MSDB tables Expand / Collapse
Posted Thursday, May 8, 2014 11:54 AM



Group: General Forum Members
Last Login: Monday, October 17, 2016 10:38 AM
Points: 105, Visits: 431
I want to query my msdb job and jobschedule related tables to generate a list of runtimes for each of these jobs for the next day or any future date. This query should output JobID, Run_Date(YYYYMMDD), and Run_Time(HHMMSS).

If I have 3 jobs with...

Job#1 scheduled to run once every 4 hours between 6 AM and 10 PM
Job# 2 scheduled to run every 15 minutes between 11 AM and 1 PM
Job# 3 scheduled to run every minute between 4 PM and 4:15 PM

my output should look as below

Thanks in advance for your inputs

  Post Attachments 
SampleJobScheduleOutput.jpg (66 views, 322.20 KB)
Post #1569057
Posted Friday, May 9, 2014 7:16 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Saturday, September 17, 2016 8:27 PM
Points: 258, Visits: 556
may i know where you need help in your query?

Every rule in a world of bits and bytes, can be bend or eventually be broken
MyBlog About Common dialog control
A Visualizer for viewing SqlCommand object script
Post #1569250
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse