View the Job History
This topic describes how to view the Microsoft SQL Server Agent job history log in SQL Server 2012 by using SQL Server Management Studio, Transact-SQL, or SQL Server Management Objects.
Before you begin:
Security
To view the job history log, using:
SQL Server Management Studio
Transact-SQL
SQL Server Management Objects
Before You Begin
Security
For detailed information, see Implement SQL Server Agent Security.
[Top]
Using SQL Server Management Studio
To view the job history log
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
Expand SQL Server Agent, and then expand Jobs.
Right-click a job, and then click View History.
In the Log File Viewer, view the job history.
To update the job history, click Refresh. To view fewer rows, click the Filter button and enter filter parameters.
[Top]
Using Transact-SQL
To view the job history log
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, click New Query.
Copy and paste the following example into the query window and click Execute.
-- lists all job information for the NightlyBackups job. USE msdb ; GO EXEC dbo.sp_help_jobhistory @job_name = N'NightlyBackups' ; GO
For more information, see sp_help_jobhistory (Transact-SQL).
[Top]
Using SQL Server Management Objects
To view the job history log
Call the EnumHistory method of the Job class by using a programming language that you choose, such as Visual Basic, Visual C#, or PowerShell. For more information, see SQL Server Management Objects (SMO).
[Top]