Skip to content

Latest commit

 

History

History
57 lines (52 loc) · 3.48 KB

dbo-sysjobsteps-transact-sql.md

File metadata and controls

57 lines (52 loc) · 3.48 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
dbo.sysjobsteps (Transact-SQL)
dbo.sysjobsteps (Transact-SQL)
VanMSFT
vanto
08/09/2016
sql
system-objects
reference
dbo.sysjobsteps
dbo.sysjobsteps_TSQL
sysjobsteps
sysjobsteps_TSQL
sysjobsteps system table
TSQL

dbo.sysjobsteps (Transact-SQL)

[!INCLUDE SQL Server]

Contains the information for each step in a job to be executed by [!INCLUDEssNoVersion] 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 [!INCLUDEssNoVersion] Agent to execute the job step.
command nvarchar(max) 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.

1 = (default) Quit with success

2 = Quit with failure

3 = Go to next step

4 = Go to step on_success_step_id
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.

1 = Quit with success

2 = (default) Quit with failure

3 = Go to next step

4 = Go to step on_fail_step_id
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, PowerShell, or CmdExec.
last_run_outcome int Outcome of the previous execution of the job step.

0 = Failed

1 = Succeeded

2 = Retry

3 = Canceled

5 = Unknown
last_run_duration int Duration (hhmmss) of the step the last time it ran.
last_run_retries int Number of retry attempts in the last execution of the job step.
last_run_date int Date (yyyymmdd) the step last started execution.
last_run_time int Time (hhmmss) the step last started execution.
proxy_id int Proxy for the job step.
step_uid uniqueidentifier Identifier for the job step.

See Also

SQL Server Agent Tables (Transact-SQL)