﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Querying the duration of the latest successful SQL Agent Job step / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 03:40:00 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Querying the duration of the latest successful SQL Agent Job step</title><link>http://www.sqlservercentral.com/Forums/Topic763256-146-1.aspx</link><description>Believe it or not, it's actually needs to be parsed out.  For example a value of 1442 translates to MM:SS.</description><pubDate>Mon, 03 Aug 2009 07:04:07 GMT</pubDate><dc:creator>Timothy Ford-473880</dc:creator></item><item><title>RE: Querying the duration of the latest successful SQL Agent Job step</title><link>http://www.sqlservercentral.com/Forums/Topic763256-146-1.aspx</link><description>Thanks Tim - this is exactly what I need.  Looks like the duration is in milliseconds.  Does that sound right?</description><pubDate>Fri, 31 Jul 2009 15:30:26 GMT</pubDate><dc:creator>bsivel</dc:creator></item><item><title>RE: Querying the duration of the latest successful SQL Agent Job step</title><link>http://www.sqlservercentral.com/Forums/Topic763256-146-1.aspx</link><description>The core table for this is msdb.dbo.sysjobhistory.  You can add a great deal of information by joining to other metadata tables in msdb, but this will get you started:[code]SELECT SJ.[name], SJH.[step_id], SJH.[step_name], SJH.[run_date], 	SJH.[run_time], SJH.[run_duration]FROM msdb.dbo.[sysjobs] SJ LEFT JOIN 	msdb.dbo.[sysjobhistory] SJH ON SJ.[job_id] = SJH.[job_id]ORDER BY SJ.[name], SJH.[run_date] DESC, SJH.[step_id][/code]</description><pubDate>Fri, 31 Jul 2009 11:18:09 GMT</pubDate><dc:creator>Timothy Ford-473880</dc:creator></item><item><title>Querying the duration of the latest successful SQL Agent Job step</title><link>http://www.sqlservercentral.com/Forums/Topic763256-146-1.aspx</link><description>I would like to query the durations of steps in several SQL Agent jobs and write them on a administrative report.  Does anyone know how or where to get these values without view the history?thanks in advance!bsivel</description><pubDate>Fri, 31 Jul 2009 10:41:05 GMT</pubDate><dc:creator>bsivel</dc:creator></item></channel></rss>