Skip to content

Instantly share code, notes, and snippets.

@Otterpohl
Last active May 19, 2022 08:50
Show Gist options
  • Save Otterpohl/840555339c32764c0e5a4d9b2eeb4b41 to your computer and use it in GitHub Desktop.
Save Otterpohl/840555339c32764c0e5a4d9b2eeb4b41 to your computer and use it in GitHub Desktop.
Gets the Agent Job Run duration without silly date and time
SELECT run_duration
,msdb.dbo.agent_datetime(run_date, run_time) AS datetime
FROM msdb.dbo.sysjobhistory
WHERE step_name = 'Enter Job Step Name Here'
ORDER BY msdb.dbo.agent_datetime(run_date, run_time) ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment