sp_droptask SQL Executive Stored Procedure

Removes a scheduled task.

Syntax

sp_droptask {name | loginname | id}

where

name
Is the name of the task to be removed.
loginname
Is a login name. If specified, all tasks assigned to that login name are dropped. If not NULL, loginname takes precedence over name and id.
id
Is the task ID of the task to be removed. If not NULL, id takes precedence over name.

Remarks

This stored procedure must be run from the msdb database.

Example

This example removes the auth_table_sync task.

sp_droptask auth_table_sync

Permission

Execute permission defaults to the public group.

Tables Used

systasks, syshistory

See Also

sp_addtask sp_purgehistory
sp_helptask sp_updatetask