Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
Disables change data capture (CDC) for the current database. Change data capture isn't available in every edition of SQL Server. For a list of features that are supported by the editions of SQL Server, see Editions and supported features of SQL Server 2022.
Transact-SQL syntax conventions
sys.sp_cdc_disable_db
[ ; ]
0
(success) or 1
(failure).
None.
sys.sp_cdc_disable_db
disables change data capture for all tables in the database currently enabled. All system objects related to change data capture, such as change tables, jobs, stored procedures and functions, are dropped. The is_cdc_enabled
column for the database entry in the sys.databases catalog view is set to 0
.
If there are many capture instances defined for the database at the time change data capture is disabled, a long running transaction can cause the execution of sys.sp_cdc_disable_db
to fail. This problem can be avoided by disabling the individual capture instances by using sys.sp_cdc_disable_table
before running sys.sp_cdc_disable_db
.
Requires membership in the sysadmin fixed server role for change data capture on Azure SQL Managed Instance or SQL Server. Requires membership in the db_owner for Change Data Capture on Azure SQL Database.
The following example disables change data capture for the AdventureWorks2022
database.
USE AdventureWorks2022;
GO
EXECUTE sys.sp_cdc_disable_db;
GO
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in