sp_delete_category (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Removes the specified category of jobs, alerts, or operators from the current server.

Topic link icon Transact-SQL Syntax Conventions


sp_delete_category [ @class = ] 'class' , [ @name = ] 'name'   


[ @class =] 'class'
The class of the category. class is varchar(8), with no default, and must have one of these values.

Value Description
JOB Deletes a job category.
ALERT Deletes an alert category.
OPERATOR Deletes an operator category.

[ @name =] 'name'
The name of the category to be removed. name is sysname, with no default.

Return Code Values

0 (success) or 1 (failure)

Result Sets



sp_delete_category must be run from the msdb database.

Deleting a category recategorizes any jobs, alerts, or operators in that category to the default category for the class.


Only members of the sysadmin fixed server role can run this procedure.


The following example deletes the job category named AdminJobs.

USE msdb ;  

EXEC dbo.sp_delete_category  
    @name = N'AdminJobs',  
    @class = N'JOB' ;  

See also

sp_add_category (Transact-SQL)
sp_help_category (Transact-SQL)
sp_update_category (Transact-SQL)
System Stored Procedures (Transact-SQL)