| title | sp_update_category (Transact-SQL) | ||
|---|---|---|---|
| description | Changes the name of a category. | ||
| 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]
Changes the name of a category.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_update_category
[ @class = ] 'class'
, [ @name = ] N'name'
, [ @new_name = ] N'new_name'
[ ; ]
The class of the category to update. @class is varchar(8), and can be one of these values.
| Value | Description |
|---|---|
ALERT |
Updates an alert category. |
JOB |
Updates a job category. |
OPERATOR |
Updates an operator category. |
The current name of the category. @name is sysname, with no default.
The new name for the category. @new_name is sysname, with no default.
0 (success) or 1 (failure).
sp_update_category must be run from the msdb database.
To run this stored procedure, users must be granted the sysadmin fixed server role.
The following example renames a job category from AdminJobs to Administrative Jobs.
USE msdb;
GO
EXECUTE dbo.sp_update_category
@class = N'JOB',
@name = N'AdminJobs',
@new_name = N'Administrative Jobs';
GO