sp_update_category (Transact-SQL)

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

Changes the name of a category.

||
|-|
|Applies to: SQL Server ( SQL Server 2008 through current version).|

Topic link icon Transact-SQL Syntax Conventions

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

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

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