Share via


View Job Activity

This topic describes how to view the runtime state of SQL Server Agent jobs in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL.

When the Microsoft SQL Server Agent service starts, a new session is created and the sysjobactivity table in the msdb database is populated with all the existing defined jobs. This table records current job activity and status. You can use the Job Activity Monitor in SQL Server Agent to view the current state of jobs. If the SQL Server Agent service unexpectedly terminates, you can refer to the sysjobactivity table to see which jobs were being executed when the service terminated.

In This Topic

  • Before you begin:  

    Security

  • To view job activity, using:

    SQL Server Management Studio

    Transact-SQL

Before You Begin

Security

For detailed information, see Implement SQL Server Agent Security.

Arrow icon used with Back to Top link [Top]

Using SQL Server Management Studio

To view job activity

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

  2. Expand SQL Server Agent.

  3. Right-click Job Activity Monitor and click View Job Activity.

  4. In the Job Activity Monitor, you can view details about each job that is defined for this server.

  5. Right-click a job to start it, stop it, enable or disable it, refresh its status as displayed in the Job Activity Monitor, delete it, or view its history or properties. To start, stop, enable or disable, or refresh multiple jobs, select multiple rows in the Job Activity Monitor, and right-click your selection.

  6. To update the Job Activity Monitor, click Refresh. To view fewer rows, click Filter and enter filter parameters.

Arrow icon used with Back to Top link [Top]

Using Transact-SQL

To view job activity

  1. In Object Explorer, connect to an instance of Database Engine.

  2. On the Standard bar, click New Query.

  3. Copy and paste the following example into the query window and click Execute.

    -- lists activity for all jobs that the current user has permission to view.
    USE msdb ;
    GO
    
    EXEC dbo.sp_help_jobactivity ;
    GO
    

For more information, see sp_help_jobactivity (Transact-SQL).

Arrow icon used with Back to Top link [Top]