0

I need to determine all SQL Server Agent Jobs that will run on a specific date in the future. Is it possible to determine all jobs that will run on a future date based on its current schedule.

I know I can get the next_run_date value from MSDB..SYSJOBSCHEDULES but need this extended somehow to pass any date in the future.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user327999
  • 443
  • 1
  • 9
  • 21
  • Can you please elaborate, with an example? I find it hard to understand what you are looking for. – Raj Nov 14 '13 at 05:23
  • Sure. Say I Have a SQL Server Agent Job that runs every 2nd Tuesday of every Month. I need a query that takes a date as a parameter and return 1 if it will be run on that date. So if I pass 12/9/2013 (2nd tuesday of December) a 1 will be returned. However, if I pass in 12/10/2013 a -1 will be returned – user327999 Nov 14 '13 at 05:28
  • Please post the script you have written to do this. Also the current result set and expected result set will surely help in getting responses – Raj Nov 14 '13 at 05:31
  • I do not have a script... i was wondering if there is a SQL Server system stored procedure that would do this. This logic has to be implemented somewhere in sql server since it is used to schedule jobs. There is a system sproc that calculates next_run_date in msdb..sysjobschedules. – user327999 Nov 14 '13 at 05:36

2 Answers2

1

http://weblogs.sqlteam.com/peterl/archive/2008/10/10/Keep-track-of-all-your-jobs-schedules.aspx

this outlines exactly what i am looking for

user327999
  • 443
  • 1
  • 9
  • 21
0

Please Try it , I hope it useful

http://www.quackit.com/sql_server/tutorial/sql_server_agent_jobs.cfm

How do I create a step in my SQL Server Agent Job which will run my SSIS package?

http://blogs.msdn.com/b/sqlagent/archive/2010/10/13/creating-multi-step-sql-agent-job.aspx

http://databases.about.com/od/sqlserver/ss/sql_server_agent_3.htm

http://bi-polar23.blogspot.in/2008/06/ssis-and-sql-server-agent-choosing.html

Community
  • 1
  • 1
code save
  • 1,054
  • 1
  • 9
  • 15
  • Most of these links reference the process of creating a SQL Server agent job. I know how to create a job with a defined scheduled. Unfortunately, these links do not answer my initial question. – user327999 Nov 14 '13 at 14:57