Skip to content

Commit

Permalink
JobHistory - Exclude In progress
Browse files Browse the repository at this point in the history
Exclude run_status 4 (in progress) from job history collection.  These rows can be produced by CDC.  It's incorrect to sum the durations for in progress rows and doing so can result in an overflow exception. Removing these from the collection will fix the issue and reduce the amount of data to collect/store for job history.  #147
  • Loading branch information
DavidWiseman committed Apr 16, 2022
1 parent b870ec5 commit d8f26d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DBADash/SQL/SQLJobHistory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
retries_attempted,
server
FROM msdb.dbo.sysjobhistory
WHERE instance_id> @instance_id
AND run_date > @run_date
WHERE instance_id> @instance_id -- Get history since last run
AND run_date > @run_date
AND run_status <> 4 -- Exclude 4 In Progress

0 comments on commit d8f26d7

Please sign in to comment.