sysjobsteps

Transact-SQL Reference

Transact-SQL Reference

sysjobsteps

Contains the information for each step in a job to be executed by SQL Server Agent. This table is stored in the msdb database.

Column name Data type Description
job_id uniqueidentifier ID of the job.
step_id int ID of the step in the job.
step_name sysname Name of the job step.
subsystem nvarchar(40) Name of the subsystem used by SQL Server Agent to execute the job step.
command nvarchar(3200) Command to be executed by subsystem.
flags int Reserved.
additional_
parameters
ntext Reserved.
cmdexec_success_
code
int Error-level value returned by CmdExec subsystem steps to indicate success.
on_success_action tinyint Action to be performed when a step is executed successfully.
on_success_step_id int ID of the next step to execute when a step is executed successfully.
on_fail_action tinyint Action to be performed when a step is not executed successfully.
on_fail_step_id int ID of the next step to execute when a step is not executed successfully.
server sysname Reserved.
database_name sysname Name of the database in which command is executed if subsystem is TSQL.
database_user_name sysname Name of the database user whose account will be used when executing the step.
retry_attempts int Number of retry attempts made if the step fails.
retry_interval int Amount of time to wait between retry attempts.
os_run_priority int Reserved.
output_file_name nvarchar(200) Name of the file in which the step's output is saved when subsystem is TSQL or CmdExec.
last_run_outcome int Outcome of the previous execution of the job step.
last_run_duration int Amount of time incurred in the previous execution of the job.
last_run_retries int Number of retry attempts in the last execution of the job step.
last_run_date int Date of the job step's previous execution.
last_run_time int Time of the job step's previous execution.