August 23, 2005 at 3:58 pm
I have tried to implement the long running jobs script as supplied by Gregory A. Larsen at http://www.databasejournal.com/features/mssql/article.php/3500276 and I thank him for the script.
The process relies on the job_id of the executing job to be present in the sysprocess table in hex format. The script joins on this table to give you the login time of a running job and thus the time the job has been executing.
My problem is that if the job has an operating system command as the only step (dts etc) then the program called by the job is populated in sysprocess table (DTS Designer for example). Does any one have/know any way that I can get the start time of a running job even if the job step is an operating system command.
What I want to do is poll my servers and write to a table, job name, start time run duration. I can get the state of the job using xp_sqlagent_enum_jobs, but I need the time a currently executing job began its execution.
Thanks
August 24, 2005 at 8:40 am
Would this be helpful ? It describes how I look at jobs & how long they run>
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=5&messageid=208602#bm208736
P.S. Post in the SQL forum next time for better viewership
August 24, 2005 at 10:25 am
Thanks for the reply, I already have a job that does the after the fact analysis. What I am looking for is to find a job running over its usual period and creating an alert when this happens. I will post this again in the SQL forum as you suggest.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply