sp_delete_jobstep#
Deleted a step from the job.
Syntax#
sp_delete_jobstep { [ @job_id = ] job_id | [ @job_name = ] 'job_name' } ,
[ @step_id = ] step_id
Arguments#
[ @job_id = ] job_id
The identification number of the job from which the step will be removed. job_id is uniqueidentifier, with a default of NULL.
[ @job_name = ] ‘job_name’
The name of the job from which the step will be removed. job_name is sysname, with a default of NULL.
Note
Either job_id or job_name must be specified; both cannot be specified.
[ @step_id = ] step_id
The identification number of the step being removed. step_id is int, with no default.
Result Sets#
None
Remarks#
Removing a job step automatically updates the other job steps that reference the deleted step.
For more information about the steps associated with a particular job, run sp_help_jobstep.
Note
Calling sp_delete_jobstep with a step_id value of zero deletes all job steps for the job.
Querona Administrative Portal provides an easy, graphical way to manage jobs, and is the recommended way to create and manage jobs.
Permissions#
By default, members of the sysadmin fixed server role can execute this stored procedure.
Only members of sysadmin can delete a job step that is owned by another user.
Examples#
The following example removes job step 1 from the job Weekly Sales Cache Rebuild.
EXEC dbo.sp_delete_jobstep
@job_name = N'Weekly Sales Cache Rebuild',
@step_id = 1 ;