Udostępnij za pośrednictwem


View a Job

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

In This Topic

  • Before you begin:

    Security

  • To view a job, using:

    SQL Server Management Studio

    Transact-SQL

    SQL Server Management Objects

Before You Begin

Security

You can only view jobs that you own, unless you are a member of the sysadmin fixed server role. Members of this role can view all jobs. For detailed information, see Implement SQL Server Agent Security.

Ikona strzałki używana z łączem Powrót na górę strony[Top]

Using SQL Server Management Studio

To view a job

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

  2. Expand SQL Server Agent, and then expand Jobs.

  3. Right-click a job, and then click Properties.

Ikona strzałki używana z łączem Powrót na górę strony[Top]

Using Transact-SQL

To view a job

  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 all aspects of the information for the job NightlyBackups.
    USE msdb ;
    GO
    
    EXEC dbo.sp_help_job
        @job_name = N'NightlyBackups',
        @job_aspect = N'ALL' ;
    GO
    

Ikona strzałki używana z łączem Powrót na górę strony[Top]

Using SQL Server Management Objects

To view a job

Use 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).

Ikona strzałki używana z łączem Powrót na górę strony[Top]