Online Documentation for SQL Administrator for SQL Server

Managing job steps


Use the Steps tab of Job Editor to manage job steps (operations). A job step is an action that the job takes on a database or a server. Every job must have at least one job step.

 

Job Editor - Managing job steps

 

 

The current job steps are displayed as a grid with the following columns: Start step, ID, Name, Type, On success Action, On failure Action.

 

Right-click an item within the list to call the context menu allowing you to create a new job step and specify its properties using the Edit Step dialog, insert a step, edit or delete the selected step.

 

The Add New Job Step / Edit Step dialog allows you to define job step parameters.

 

Steps ID start with 1 and increment in numerical order. If the step is inserted into an existing sequence then order numbers change automatically.

 

Step Editor

 

General

The General tab allows you to define basic parameters of the step.

 

Job Editor - Job Step Editor - General

 

 

Name

Enter a name for the new step, or modify the name of the step being edited.

 

Specify the Step Type of the step indicating the subsystem used by Microsoft SQL Server Agent service to execute the job command:

Transact-SQL statement

Operating-system command or executable program

ActiveX Script

Replication Distribution Agent job

Replication Snapshot Agent job

Replication Log Reader Agent job

Replication Merge Agent job

Replication Queue Reader Agent job

Analysis Services query (MDX, DMX)

Analysis Services command (XMLA)

Integration Services package execution

 

Use the Database drop-down list to select the database for which the current step will be executed (for Transact-SQL command type step; for an ActiveX job step, you are to specify the name of the scripting language that the step uses), and specify the security context under which the command is executed using the Run as user drop-down list.

 

Use the Command text memo field to enter the job step command code: SQL code (for Transact-SQL step), Visual Basic Script / Java Script / other script code (for ActiveX Script step), or OS command / executable program (for Operating-system command step).

 

 

Advanced

The Advanced tab provides flexible job step control of flow for success and failure.

 

Job Editor - Job Step Editor - Advanced

 

 

Specify the Action when step succeeds, i.e. the action the job will take if the step succeeds:

!RadioButton Go to next step

!RadioButton Quit job with success

!RadioButton Quit job with failure

!RadioButton Go to step ... (select the step from the drop-down list)

 

Specify the Action when step fails, i.e. the action the job will take if the step fails:

!RadioButton Go to next step

!RadioButton Quit job with success

!RadioButton Quit job with failure

!RadioButton Go to step ... (select the step from the drop-down list)

 

The Retries if step fails group allows you to set optional parameters for the job step: the Number of retry attempts and the Retry interval between attempts (in minutes).

 

Log of step command/query output

SQL Server Agent can write output from some job steps either to the sysjobsteplogs table in the msdb database or to an operating system file.

To use this feature, set the path and the file name in the To file field, and/or check !CheckBox To step log table (msdb.dbo.sysjobsteplogs) and/or !CheckBox To job history.