Find out when a job will run next in T-SQL

Could be useful in a report – i think ive only used it once:

Select DISTINCT CAST(j.name AS CHAR(50)) AS 'Job Name', 
s.next_run_date, s.next_run_time from msdb..sysjobs j, msdb..sysjobschedules s 
WHERE j.job_id = s.job_id
AND s.next_run_date > convert(char(11), dateadd(day, -1, getdate()), 112)
--AND j.name like 'FPLive Full%'
ORDER BY s.next_run_date asc, s.next_run_time

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: