sp_help_category (Transact-SQL)
Provides information about the specified classes of jobs, alerts, or operators.
When @suffix is 0, sp_help_category returns the following result set:
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 |
When @suffix is 1, sp_help_category returns the following result set:
Column name | Data type | Description |
|---|---|---|
category_id | int | Category ID |
category_type | sysname | Type of category. One of LOCAL, MULTI-SERVER, or NONE |
name | sysname | Category name |
By default, members of the sysadmin fixed server role can execute this stored procedure. Other users must be granted one of the following SQL Server Agent fixed database roles in the msdb database:
SQLAgentUserRole
SQLAgentReaderRole
SQLAgentOperatorRole
For details about the permissions of these roles, see SQL Server Agent Fixed Database Roles.
A. Returning local job information
The following example returns information about jobs that are administered locally.
USE msdb ;
GO
EXEC dbo.sp_help_category
@type = N'LOCAL' ;
GO
B. Returning alert information
The following example returns information about the Replication alert category.
USE msdb ;
GO
EXEC dbo.sp_help_category
@class = N'ALERT',
@name = N'Replication' ;
GO