| title | sp_delete_jobschedule (Transact-SQL) | ||
|---|---|---|---|
| description | sp_delete_jobschedule deletes a schedule for a job in the SQL Server Agent service. | ||
| author | markingmyname | ||
| ms.author | maghan | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
||
| monikerRange | >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current |
[!INCLUDE sql-asdbmi]
Deletes a schedule for a job in the [!INCLUDE ssnoversion-md] Agent service.
sp_delete_jobschedule is provided for backward compatibility only.
[!INCLUDE ssnotedepfutureavoid-md]
Job schedules can now be managed independently of jobs. To remove a schedule from a job, use sp_detach_schedule. To delete a schedule, use sp_delete_schedule.
sp_delete_jobschedule doesn't support schedules that are attached to multiple jobs. If an existing script calls sp_delete_jobschedule to remove a schedule that is attached to more than one job, the procedure returns an error.
[!INCLUDE msdb-execute-permissions]
Other users must be granted one of the following [!INCLUDE ssNoVersion] 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 role can delete any job schedule. Users who aren't members of the sysadmin role can only delete job schedules that they own.