Assign a Job to a Job Category
This topic describes how to assign Microsoft SQL Server Agent jobs to job categories in SQL Server 2016 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. You can assign jobs to built-in job categories, or you can create a user-defined job category and then assign jobs to that.
In This Topic
Before you begin:
To assign a job to a job category, using:
For detailed information, see Implement SQL Server Agent Security.
In Object Explorer, click the plus sign to expand the server where you want to assign a job to a job category.
Click the plus sign to expand SQL Server Agent.
Click the plus sign to expand the Jobs folder.
Right-click the job you want to edit and select Properties.
In the Job Properties -job_name dialog box, in the Category list, select the job category you want to assign to the job.
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.
-- adding a new job category to the "NightlyBackups" job USE msdb ; GO EXEC dbo.sp_update_job @job_name = N'NightlyBackups', @category_name = N'[Uncategorized (Local)]'; GO
For more information, see sp_update_job (Transact-SQL).
To assign a job to a job category
Use the JobCategory class by using a programming language that you choose, such as Visual Basic, Visual C#, or PowerShell.