Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Delete Jobs

SQL Server 2012

A job is a specified series of operations performed sequentially by SQL Server Agent. By default, jobs are not deleted when execution finishes. You can delete one or more Microsoft SQL Server Agent jobs regardless of success or failure of the job. You can also configure Microsoft SQL Server Agent to automatically delete jobs when they succeed, fail, or complete.

By default, members of the sysadmin fixed server role can execute the sp_delete_job (Transact-SQL) system stored procedure to delete a job. 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.

Members of the sysadmin fixed server role can execute sp_delete_job to delete any job. A user that is not a member of the sysadmin fixed server role can only delete jobs owned by that user.

Description

Topic

Describes how to delete one or more Microsoft SQL Server Agent jobs.

Delete One or More Jobs

Describes how to configure Microsoft SQL Server Agent to automatically delete jobs when they succeed, fail, or complete.

Automatically Delete a Job

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.