Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 1.88 KB

sys-sp-cdc-drop-job-transact-sql.md

File metadata and controls

73 lines (51 loc) · 1.88 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sys.sp_cdc_drop_job (Transact-SQL)
Removes a change data capture cleanup or capture job for the current database from msdb.
markingmyname
maghan
randolphwest
08/21/2024
sql
system-objects
reference
sys.sp_cdc_drop_job_TSQL
sp_cdc_drop_job_TSQL
sp_cdc_drop_job
sys.sp_cdc_drop_job
sp_cdc_drop_job
TSQL

sys.sp_cdc_drop_job (Transact-SQL)

[!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

Syntax

sys.sp_cdc_drop_job [ [ @job_type = ] N'job_type' ]
[ ; ]

Arguments

[ @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.

Return code values

0 (success) or 1 (failure).

Result set

None.

Remarks

sp_cdc_drop_job is called internally by sys.sp_cdc_disable_db.

Permissions

Requires membership in the db_owner fixed database role.

Examples

The following example removes the cleanup job for the [!INCLUDE sssampledbobject-md] database.

USE AdventureWorks2022;
GO

EXEC sys.sp_cdc_drop_job @job_type = N'cleanup';

Related content