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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Actual start time Job

Author  Topic 

Sprinjee
Starting Member

42 Posts

Posted - 2007-08-24 : 07:22:57
I want to find out the start time of a job. I've seen many posts about retrieving the start time from sp_help_job, however this is not always the last start (run) time; as it does not register the starttime on start but when the job becomes idle:

12:43:00 Manually Start the job A
12:45:00 Job Succeeds
12:46:00 SP_Help_Job returns 12:53

12:53:00 Manually Start the job A again
12:54:00 SP_Help_Job returns 12:43 (instead of 12:53) <--
12:55:00 Job Succeeds
12:56:00 SP_Help_Job returns 12:53

At point <-- I would like to able retrieve the last time the job started which is 12:53. Does anyone know if this is even possible?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-24 : 07:27:41
What about jobhistory table?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Sprinjee
Starting Member

42 Posts

Posted - 2007-08-24 : 07:52:28
SP_Help_Job retrieves the information from the jobhistory table so that won't do...

SQL does retain the information (as it is inserted into the jobhistory table when the job becomes idle). Questions is whether this information is stored in the memory or a table/log etc.
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2007-08-24 : 09:45:47
Can you not log it yourself as the 1st step in the job...ie execute an insert into a local table?
Go to Top of Page

Sprinjee
Starting Member

42 Posts

Posted - 2007-08-27 : 03:25:13
Andrew that of course would be a good solution to the issue. The thing is I do not want to modify any existing job. The package is going to be installed on multiple servers having many jobs. Modifying the jobs would take too much time and is not convenient from a maintenance perspective.
Go to Top of Page
   

- Advertisement -