Delete a Job Category
This topic describes how to delete a Microsoft SQL Server Agent job category in SQL Server 2012 by using SQL Server Management Studio, Transact-SQL or SQL Server Management Objects.
Job categories help you organize your jobs for easy filtering and grouping. For example, you can organize all your database backup jobs in the Database Maintenance category.
In This Topic
Before you begin:
Limitations and Restrictions
Security
To delete a job category, using:
SQL Server Management Studio
Transact-SQL
SQL Server Management Objects
Before You Begin
Limitations and Restrictions
When you delete a user-defined job category, SQL Server Agent prompts you to reassign the jobs that are assigned to it to another job category. You can only delete user-defined job categories.
Security
For detailed information, see Implement SQL Server Agent Security.
[Top]
Using SQL Server Management Studio
To delete a job category
In Object Explorer, click the plus sign to expand the server where you want to delete a job category.
Click the plus sign to expand SQL Server Agent.
Right-click the Jobs folder and select Manage Job Categories.
In the Manage Job Categories server_name dialog box, select the job category to delete.
Click Delete.
In the Job Categories dialog box, click Yes.
Close the Manage Job Categories server_name dialog box.
[Top]
Using Transact-SQL
To delete a job category
In Object Explorer, connect to an instance of Database Engine.
On the Standard bar, click New Query.
Copy and paste the following example into the query window and click Execute.
-- deletes the job category named AdminJobs. USE msdb ; GO EXEC dbo.sp_delete_category @name = N'AdminJobs', @class = N'JOB' ; GO
For more information, see sp_delete_category (Transact-SQL).
[Top]
Using SQL Server Management Objects
To delete a job category
Call the JobCategory class by using a programming language that you choose, such as Visual Basic, Visual C#, or PowerShell. For more information, see SQL Server Management Objects (SMO).
[Top]