How can I view full SQL Job History?

Curt picture Curt · Oct 13, 2011 · Viewed 79.9k times · Source

In SQL Server Management Studio, when I "View History" for a SQL Job, I'm only shown the last 50 executions of the Job.

How can I view a full log of every execution of a SQL Job since it was created on the server?

Answer

Jeremy Smyth picture Jeremy Smyth · Oct 13, 2011

The SQL Server Job system limits the total number of job history entries both per job and over the whole system. This information is stored in the MSDB database.

Obviously you won't be able to go back and see information that has been since discarded, but you can change the SQL Server Agent properties and increase the number of entries that will be recorded from now on.

In the SQL Server Agent Properties:

  • Select the History page
  • Modify the 'Maximum job history log size (rows)' and 'Maximum job history rows per job' to suit, or change how historical job data is deleted based on its age.

It won't give you back your history, but it'll help with your future queries!