Previous Topic: Define a MSSQL Server JobNext Topic: Search for a Target Server that the Microsoft SQL Server Agent Job Can Run on


Search for a Microsoft SQL Server Agent Job

You can use the Search MSSQL Jobs dialog to search for and select a job that is defined in Microsoft SQL Server Agent.

Follow these steps:

  1. Ensure you are connected to the server.
  2. Open the Basic page of the MSSQL Server job definition.
  3. Specify the name of the agent that runs the MSSQL Server job in the Agent name field.
  4. Click the arrow search button next to the Job name/job ID field.

    The Search MSSQL Jobs dialog opens.

    Note: The fields in this dialog are populated with the information that is specified on the Basic page of the job definition, if any.

  5. (Optional) Specify the filter criteria in the following fields in the Filter Options section:
    Job Type

    Specifies the job type to filter on. Options are LOCAL and MULTI-SERVER. The default is to return all jobs regardless of job type.

    Owner Login Name

    Specifies the login name of the owner of the job to filter on. The default is to return all jobs regardless of the owner login name.

    Category

    Specifies the category name to filter on. Options are as follows:

    • Uncategorized (Local)
    • Data Collector
    • Database Engine Tuning Advisor
    • Database Maintenance
    • Full-Text
    • Jobs From MSX
    • Log Shipping
    • REPL-Alert Response
    • REPL-Checkup
    • REPL-Distribution
    • REPL-Distribution Cleanup
    • REPL-History Cleanup
    • REPL-LogReader
    • REPL-Merge
    • REPL-QueueReader
    • REPL-Snapshot
    • REPL-Subscription Cleanup

    The default is to return all jobs regardless of category.

    Subsystem

    Specifies the name of the subsystem to filter on. Options are as follows:

    • TSQL
    • ActiveScripting
    • CmdExec
    • Snapshot
    • LogReader
    • Distribution
    • Merge
    • QueueReader
    • AnalysisQuery
    • AnalysisCommand
    • SSIS
    • PowerShell

    Note: When this field is specified, only jobs with job steps that belong to the specified subsystem are listed. The default is to return all jobs regardless of subsystem.

    Execution Status

    Specifies the execution status to filter on. Options are as follows:

    Suspended

    Lists only jobs that are not idle or suspended.

    Executing

    Lists only jobs that are executing.

    WaitingForThread

    Lists only jobs that are waiting for a thread.

    BetweenRetries

    Lists only jobs that are between retries.

    Idle

    Lists only jobs that are idle.

    PerformingCompletionActions

    Lists only jobs that are performing completion options.

    The default is to return all jobs regardless of execution status.

    Date

    Specifies a date range based on when the job was created or last modified. To filter by date, specify the following:

    • Type of date (DateCreated or DateLastModified)
    • Date comparator (After or Before)
    • Date (using the calendar)
    • Time

    Example: DateCreated After Sept 13, 2013 12:00:00 AM (returns jobs that were created since midnight on September 13, 2013).

    Enabled

    Indicates whether to list only enabled or disabled jobs.

    TRUE

    Lists only enabled jobs.

    FALSE

    Lists only disabled jobs.

    The default is to return enabled and disabled jobs.

    Description

    Specifies the job description to filter on. The Description field can include the wildcard characters *, ?, ^, and [] for pattern matching. The * wildcard character is equivalent to the % SQL wildcard character. The ? wildcard character is equivalent to the _ SQL wildcard character. The default is to return all jobs regardless of description.

  6. Click the arrow search button next to the MSSQL server info section.

    The List of Jobs table is populated with the list of jobs that meet the search criteria.

    Notes:

  7. Select the job you want from the table.
  8. Click Select Job Name to specify the job name or click Select Job ID to specify the job ID in the job definition.

    The specified job name or job ID of the selected job is set on the Basic page of the job definition.

Example: Retrieve a List of Microsoft SQL Server Agent Jobs Based on Job Description Criteria

Suppose that you want to retrieve a list of all jobs with the job description that starts with sqljob.

To list the Microsoft SQL Server Agent jobs based on job description criteria

  1. Open the Basic page of the MSSQL Server job definition.
  2. Enter AGENT_MSSQL in the Agent name field.
  3. Click the arrow search button next to the Job name/job ID field.

    The Search MSSQL Jobs dialog opens.

  4. Enter sqljob* in the Description field.
  5. Click the arrow search button next to the MSSQL server info section.

    The List of Jobs table is populated with the list of jobs that meet the search criteria.