sp_help_category

Transact-SQL Reference

Transact-SQL Reference

sp_help_category

Provides information about the specified classes of jobs, alerts, or operators.

Syntax

sp_help_category [ [ @class = ] 'class' ]
    [ , [ @type = ] 'type' ]
    [ , [ @name = ] 'name' ]
    [ , [ @suffix = ] suffix ]

Arguments

[@class =] 'class'

Is the class about which information is requested. class is varchar(8), with a default value of JOB. class can be one of these values.

Value Description
JOB Provides information about a job category.
ALERT Provides information about an alert category.
OPERATOR Provides information about an operator category.

[@type =] 'type'

Is the type of category for which information is requested. type is varchar(12), with a default of NULL, and can be one of these values.

Value Description
LOCAL Local job category.
MULTI -SERVER Multiserver job category.
NONE Category for a class other than JOB.

[@name =] 'name'

Is the name of the category for which information is requested. name is sysname, with a default of NULL.

[@suffix =] suffix

Specifies whether the category_type column in the result set is an ID or a name. suffix is bit, with a default of 0. 1 shows the category_type as a name, and 0 shows it as an ID.

Return Code Values

0 (success) or 1 (failure)

Result Sets
Column name Data type Description
category_id int Category ID
category_type tinyint Type of category:

1 = Local
2 = Multiserver
3 = None

name sysname Category name

Remarks

sp_help_category must be executed in the msdb database.

If no parameters are specified, the result set provides information about all of the job categories.

Permissions

Execute permissions default to the public role. Anyone who can execute this procedure can also create, delete, or update a job, job step, job category, job schedule, job server, task, or job history information.

Examples
A. Return local job information

This example returns information about jobs that are administered locally.

USE msdb
EXEC sp_help_category @type = 'LOCAL'
B. Return alert information

This example returns information about the Replication alert category.

USE msdb
EXEC sp_help_category @class = 'ALERT', @name = 'Replication'

See Also

sp_add_category

sp_delete_category

sp_update_category

System Stored Procedures