| title | sys.sp_cdc_drop_job (Transact-SQL) | ||||
|---|---|---|---|---|---|
| description | Removes a change data capture cleanup or capture job for the current database from msdb. | ||||
| 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 |
|
[!INCLUDE SQL Server]
Removes a change data capture cleanup or capture job for the current database from msdb.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sys.sp_cdc_drop_job [ [ @job_type = ] N'job_type' ]
[ ; ]
Type of job to remove. job_type is nvarchar(20) and can't be NULL. Valid inputs are capture and cleanup.
0 (success) or 1 (failure).
None.
sp_cdc_drop_job is called internally by sys.sp_cdc_disable_db.
Requires membership in the db_owner fixed database role.
The following example removes the cleanup job for the [!INCLUDE sssampledbobject-md] database.
USE AdventureWorks2022;
GO
EXECUTE sys.sp_cdc_drop_job @job_type = N'cleanup';