| title | sp_delete_category (Transact-SQL) | ||
|---|---|---|---|
| description | Removes the specified category of jobs, alerts, or operators from the current server. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Removes the specified category of jobs, alerts, or operators from the current server.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_delete_category
[ @class = ] 'class'
, [ @name = ] N'name'
[ ; ]
The class of the category. @class is varchar(8), with no default, and must be one of these values.
| Value | Description |
|---|---|
JOB |
Deletes a job category. |
ALERT |
Deletes an alert category. |
OPERATOR |
Deletes an operator category. |
The name of the category to be removed. @name is sysname, with no default.
0 (success) or 1 (failure).
None.
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.
[!INCLUDE msdb-execute-permissions]
The following example deletes the job category named AdminJobs.
USE msdb;
GO
EXECUTE dbo.sp_delete_category
@name = N'AdminJobs',
@class = N'JOB';
GO