Skip to content

Latest commit

 

History

History
89 lines (64 loc) · 2.13 KB

sp-update-category-transact-sql.md

File metadata and controls

89 lines (64 loc) · 2.13 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_update_category (Transact-SQL)
Changes the name of a category.
markingmyname
maghan
randolphwest
08/28/2023
sql
system-objects
reference
sp_update_category
sp_update_category_TSQL
sp_update_category
TSQL

sp_update_category (Transact-SQL)

[!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

Syntax

sp_update_category
    [ @class = ] 'class'
    , [ @name = ] N'name'
    , [ @new_name = ] N'new_name'
[ ; ]

Arguments

[ @class = ] 'class'

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.

[ @name = ] N'name'

The current name of the category. @name is sysname, with no default.

[ @new_name = ] N'new_name'

The new name for the category. @new_name is 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

Related content