Delete One or More Jobs
This topic describes how to delete Microsoft SQL Server Agent jobs in SQL Server 2012 by using SQL Server Management Studio, Transact-SQL, or SQL Server Management Objects.
In This Topic
-
Before you begin:
-
To delete a job(s), using:
To delete a job
-
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
-
Expand SQL Server Agent, expand Jobs, right-click the job you want to delete, and then click Delete.
-
In the Delete Object dialog box, confirm that the job you intend to delete is selected.
-
Click OK.
To delete multiple jobs
-
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
-
Expand SQL Server Agent.
-
Right-click Job Activity Monitor, and click View Job Activity.
-
In the Job Activity Monitor, select the jobs you want to delete, right-click your selection, and choose Delete jobs.
To delete a 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.
USE msdb ; GO EXEC sp_delete_job @job_name = N'NightlyBackups' ; GO
For more information, see sp_delete_job (Transact-SQL).
To delete multiple jobs
Use the JobCollection 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).
