August 25, 2006 at 5:20 am
I've found plenty of questions related to this but so far no satisfactory outcome. Nothing in this forum either.
Running SQL Server 2000 SP4.
Basically, I'm trying to retrieve (programatically, T-SQL) the starting date/time of jobs that are currently running. History is no problem. But SQL must get the start date from somewhere in order to derive history values.
Any help appreciated
Kevin Pickering
August 25, 2006 at 7:29 am
I never came up with this problem. What query have you come up with and what is the problem you are encountering?
August 25, 2006 at 7:30 am
In the msdb database if you query sys.jobs and sys.jobactivity and join them on the job_id and query for any jobs which have a start_execution and date and NULL for the stop_execution date I believe should give you what you want.
hth
David
August 25, 2006 at 8:39 am
Ok, in msdb we have dbo.sysjobs (not sys.jobs) but we do not have sys.jobactivity (nor dbo.sysjobactivity). Can you explain where this is located. It sounds like it has the information I require.
Thanks,
Kevin
August 25, 2006 at 3:11 pm
I am running sql server 2005 and the table dbo.sysjobactivity exists within it but maybe it does not on previous versions
hth
David
August 28, 2006 at 11:51 am
Use sysjobs and sysjobschedules
August 29, 2006 at 1:03 pm
use sysjobs and sysjobschedules (join on job_id) will give you what you see in Management->SQL Server Agent->Jobs
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply