June 21, 2012 at 1:21 am
hi all
please help me out to get the execution time of Scheduled task in sql server.i want to get time in seconds like hh:mm:ss .
Thanks
selva
--------------------------------------------------------
I am Learner -- SQL
June 21, 2012 at 2:03 am
The MSDB database will contain what you need especially the run duration column in sysjobhistory which is in seconds, then you just need to format it how you want it formatting.
June 22, 2012 at 4:50 am
FYI: The column is called run_time and you will have to jump through hoops to get it formated the way you want it. Not only does it count hours in Zulu time, but it drops leading zeros.
So, IIRC, 54820 is 5:48.20 a.m. and 164820 is 4:48.20 p.m.
June 22, 2012 at 4:57 am
Ah, now the question raises, is it the OP refering to execution time as the time the job started, or the length of time the job took to complete?
I took it as execution time = time the job took to complete, hence the run_duration column, but if it is the start time of the schedule then yes run_time is the column to look at.
June 22, 2012 at 5:04 am
That is a good point, Anthony. We were reading that question two different ways.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply