Tuesday, March 20, 2012

Scheduled job finish time

I would like to find out how long the last execution of a scheduled
task takes to run. Each job i'm looking at has only 1 task. I'm not
crazy about the idea of creating a fake job step to be able to see when
that step starts to know when the "real" job step ended. Is there a
good way to find out the run duration for a job?
KalvinNot sure I follow you. If you right click on the job and choose History you
can see the time the job took. If you check the box for the details it will
expand and show each step as well. If you only have one step (which every
job needs) it is pretty obvious either way.
Andrew J. Kelly SQL MVP
"Kalvin" <ktuel@.streck.com> wrote in message
news:1121874591.381433.81960@.g44g2000cwa.googlegroups.com...
>I would like to find out how long the last execution of a scheduled
> task takes to run. Each job i'm looking at has only 1 task. I'm not
> crazy about the idea of creating a fake job step to be able to see when
> that step starts to know when the "real" job step ended. Is there a
> good way to find out the run duration for a job?
> Kalvin
>|||Would the following system SP give you what you need:
sp_help_jobhistory [ [ @.job_id = ] job_id ]
[ , [ @.job_name = ] 'job_name' ]
[ , [ @.step_id = ] step_id ]
[ , [ @.sql_message_id = ] sql_message_id ]
[ , [ @.sql_severity = ] sql_severity ]
[ , [ @.start_run_date = ] start_run_date ]
[ , [ @.end_run_date = ] end_run_date ]
[ , [ @.start_run_time = ] start_run_time ]
[ , [ @.end_run_time = ] end_run_time ]
[ , [ @.minimum_run_duration = ] minimum_run_duration ]
[ , [ @.run_status = ] run_status ]
[ , [ @.minimum_retries = ] minimum_retries ]
[ , [ @.oldest_first = ] oldest_first ]
[ , [ @.server = ] 'server' ]
[ , [ @.mode = ] 'mode' ]
"Kalvin" <ktuel@.streck.com> wrote in message
news:1121874591.381433.81960@.g44g2000cwa.googlegroups.com...
>I would like to find out how long the last execution of a scheduled
> task takes to run. Each job i'm looking at has only 1 task. I'm not
> crazy about the idea of creating a fake job step to be able to see when
> that step starts to know when the "real" job step ended. Is there a
> good way to find out the run duration for a job?
> Kalvin
>|||yes, that does it.
Thanks
Kalvin
*** Sent via Developersdex http://www.examnotes.net ***

No comments:

Post a Comment