Monday 22 August 2016

Mini Post: SQL Server Agent Job History

Hey all, welcome back to SQL Something. Man, has it been a while. Too long.

Unfortunate to say however, this post will not be particularly epic to make up for the long absence. Like, not epic at all. But, you know what? Let's go into it. If it helps one person, then that's plenty. :-)

Today we are looking at SQL Server Agent Job history.

A SQL Server Job allows us to automate a process to run at particular times, either as a one time event or repeatedly for some specified duration (or indefinitely). Setting up jobs for performing backups is an example of a great way to use jobs.

A job's history can show us a number of things. It can show us if the job ran successfully and if not, it can give us an indicator as to why. It can also show us some useful info such as the creds used to invoke the job, as well as the duration of time taken for the job to run (this last I find pretty helpful).


Jobs that are created can be found in the SQL Server Agent tab in Management Studio as shown in Fig. 1.

Fig. 1: Finding a Job...


Expand the tab and right click the job you wish to view the history of. After right clicking, select "View History". This would open up the log file viewer as shown in Fig. 2.

Fig. 2: Seeing when a Job was run. Undercover Boss...


Here you will see a list of all the times the job was invoked. If there is a green tick next to the job, it was invoked successfully. A red 'X' indicates a problem occurred when the job was run at a particular time.

You can expand a date that a job ran to get more info as shown in Fig. 3.

Fig. 3: Info about the Job. Job ran successfully...


Under 'Message', you will get info about when the job ran that particular time.

And that is really all there is to it. Hope to write you all a lot sooner rather than later next time. :-)


DISCLAIMER: As stated, I’m not an expert so please, PLEASE feel free to politely correct or comment as you see fit. Your feedback is always welcomed. :-)

No comments:

Post a Comment