Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Bill_C
Constraint Violating Yak Guru
299 Posts |
Posted - 2012-02-09 : 02:46:24
|
I'm trying to check if a particular job is running, and if it is not, when it last ran so I can use this info to decide whether the job needs to run again (based on if we have recieved new data since the job was last run).sort of thing I'm looking for goes along the lines of:-select COUNT(1) from msdb.dbo.sysjobhistory ainner join msdb.dbo.sysjobs b ona.job_id = b.job_idwhere b.name = 'myjobname'and CAST(a.run_date as date) = '09 fed 2012'and CAST(run_time as time(0)) > '01:00' |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|