Share via


Change Steps of a SQL Server Agent Master Job

This topic describes how to make changes to the steps of a SQL Server Agent master job in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL.

In This Topic

  • Before you begin:

    Limitations and Restrictions

    Security

  • To make changes to the steps of a SQL Server Agent master job, using:

    SQL Server Management Studio

    Transact-SQL

Before You Begin

Limitations and Restrictions

A SQL Server Agent master job cannot be targeted at both local and remote servers.

Security

Permissions

Unless you are a member of the sysadmin fixed server role, you can only modify jobs that you own. For detailed information, see Implement SQL Server Agent Security.

Arrow icon used with Back to Top link [Top]

Using SQL Server Management Studio

To make changes to the steps of a SQL Server Agent master job

  1. In Object Explorer, click the plus sign to expand the server that contains the job where you want to modify steps.

  2. Click the plus sign to expand SQL Server Agent.

  3. Click the plus sign to expand the Jobs folder.

  4. Right-click the job where you want to modify steps and select Properties.

  5. In the Job Properties – job_name dialog box, under Select a page, select Steps.

  6. Click Edit to open the Job Step Properties – job_step_name dialog box. For more information on the available options in this dialog box, see Job Step Properties / New Job Step (General Page) and Job Step Properties / New Job Step (Advanced Page).

  7. When finished, click OK.

  8. In the Job Properties – job_name dialog box, click OK.

Arrow icon used with Back to Top link [Top]

Using Transact-SQL

To make changes to the steps of a SQL Server Agent master 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.

    -- changes the number of retry attempts for the first step of the Weekly Sales Data Backup job. 
    -- After running this example, the number of retry attempts is 10 
    USE msdb ;
    GO
    
    EXEC dbo.sp_update_jobstep
        @job_name = N'Weekly Sales Data Backup',
        @step_id = 1,
        @retry_attempts = 10 ;
    GO
    

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

Arrow icon used with Back to Top link [Top]