sp_update_category (Transact-SQL)
Changes the name of a category.
Syntax
sp_update_category
[@class =] 'class' ,
[@name =] 'old_name' ,
[@new_name =] 'new_name'
Arguments
[ @class =] 'class'
The class of the category to update. classis varchar(8), with no default, and can be one of these values.Value Description ALERT
Updates an alert category.
JOB
Updates a job category.
OPERATOR
Updates an operator category.
- [ @name =] 'old_name'
The current name of the category. old_nameis sysname, with no default.
- [ @new_name =] 'new_name'
The new name for the category. new_nameis sysname, with no default.
Return Code Values
0 (success) or 1 (failure)
Remarks
sp_update_category must be run from the msdb database.
Permissions
To run this stored procedure, users must be granted the sysadmin fixed server role.
Examples
A. Renaming a job category
The following example renames a job category from AdminJobs
to Administrative Jobs
.
USE msdb ;
GO
EXEC dbo.sp_update_category
@class = N'JOB',
@name = N'AdminJobs',
@new_name = N'Administrative Jobs' ;
GO
See Also
Reference
sp_add_category (Transact-SQL)
sp_delete_category (Transact-SQL)
sp_help_category (Transact-SQL)
System Stored Procedures (Transact-SQL)