TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

sp_add_category (Transact-SQL)

 

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

Adds the specified category of jobs, alerts, or operators to the server.

Topic link icon Transact-SQL Syntax Conventions

  
sp_add_category   
     [ [ @class = ] 'class', ]   
     [ [ @type = ] 'type', ]   
     { [ @name = ] 'name' }  

[ @class = ] 'class'
The class of the category to be added. class is varchar(8) with a default value of JOB, and can be one of these values.

ValueDescription
JOBAdds a job category.
ALERTAdds an alert category.
OPERATORAdds an operator category.

[ @type = ] 'type'
The type of category to be added. type is varchar(12), with a default value of LOCAL, and can be one of these values.

ValueDescription
LOCALA local job category.
MULTI-SERVERA multiserver job category.
NONEA category for a class other than JOB.

[ @name = ] 'name'
The name of the category to be added. The name must be unique within the specified class. name is sysname, with no default.

0 (success) or 1 (failure)

None

sp_add_category must be run from the msdb database.

Only members of the sysadmin fixed server role can execute sp_add_category.

The following example creates a local job category named AdminJobs.

USE msdb ;  
GO  
  
EXEC dbo.sp_add_category  
    @class=N'JOB',  
    @type=N'LOCAL',  
    @name=N'AdminJobs' ;  
GO  

sp_delete_category (Transact-SQL)
sp_help_category (Transact-SQL)
sp_update_category (Transact-SQL)
dbo.sysjobs (Transact-SQL)
dbo.sysjobservers (Transact-SQL)
System Stored Procedures (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft