Delen via


sp_update_category (Transact-SQL)

Changes the name of a category.

Topic link iconTransact-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