sp_sjobdrop

Description

Deletes a job, a schedule, or a scheduled job.

By default, the name argument is the name or ID of a scheduled job. To specify the name or ID for a job or a schedule the name argument is prefixed with jname or sname.��

Syntax

sp_sjobdrop @name=’...’, @option=’...’

Parameters

name

The name or ID of the scheduled job, job, or schedule to delete.

option

A list of options for the command:

(See the Usage section for more details on these parameters.)

Returns

Returns 0 on success or an error code.

Examples

Example 1

The following example deletes the scheduled job called “svr1_clean_stats”: �

sp_sjobdrop ’svr1_clean_stats’

Example 2

The following example deletes the schedule called “daily 01:00am”:

sp_sjobdrop ’sname=daily 01:00am’�

Example 3

The following example deletes the job called “load_sales_data”�:

sp_sjobdrop ’jname=load_sales_data’�

Example 4

The following example deletes the job called “load_sales_data” and any scheduled jobs the caller owns that were using it.

sp_sjobdrop @name=’jname=load_sales_data’, @option=’all’�

Usage

For the general administration of jobs and schedules, the all and all_users options are provided. The following describes these options:�

The show option is provided so you can see which scheduled jobs, jobs, and schedules would be deleted by a call to sp_dropjob—without actually deleting them.�