Online Documentation for SQL Manager 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.

 

Jobs - 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, On failure, Last run outcome, Last run date, Command.

 

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.

 

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

 

Jobs - Job Editor - Job Step Editor - General

 

 

Job step name

Enter a name for the new step, or modify the name of the step being edited. If necessary, you can specify to CheckBox Start job with this step. Note that a job can have only one start step.

 

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

Tick Transact-SQL statement

Tick Active Script

Tick Operating-system command or executable program

Tick Replication Distribution Agent job

Tick Replication Snapshot Agent job

Tick Replication Log Reader Agent job

Tick Replication Merge Agent job

Tick Replication Queue Reader Agent job

Tick Analysis Services query (MDX, DMX)

Tick Analysis Services command (XMLA)

Tick Integration Services package execution

Tick PowerShell Script

 

Use the Database name 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.

 

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, check the CheckBox Add output to step history option and set the path and the file name in the Output file name field, and/or check CheckBox Log step output to msdb..sysjobsteplogs table.

 

You can select the CheckBox Overwrite option to specify that the existing destination log file / table will be overwritten.

 

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 Active Script step), or OS command / executable program (for Operating-system command step).

 

 

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

 

Jobs - Job Editor - Job Step Editor - Advanced

 

 

Specify the On success action, i.e. the action the job will take if the step succeeds:

RadioButton Quit job with success

RadioButton Quit job with failure

RadioButton Go to next step

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

 

Specify the On failure action, i.e. the action the job will take if the step fails:

RadioButton Quit job with success

RadioButton Quit job with failure

RadioButton Go to next step

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

 

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

 

The Info group contains common information about the job step:

Last run date

Last run status

Last run attempts

Last run duration