Returns the data definition language (DDL) change history associated with the specified capture instance since change data capture was enabled for that capture instance. Change data capture is not available in every edition of Microsoft SQL Server. For a list of features that are supported by the editions of SQL Server, see Features Supported by the Editions of SQL Server 2014.
Applies to: SQL Server (SQL Server 2008 through current version).
Name of the source table schema.
Name of the source table.
Name of the capture instance.
Indicates the DDL change required a column in the change table to be altered to reflect a data type change made to the source column.
The DDL statement applied to the source table.
Log sequence number (LSN) associated with the DDL change.
Time associated with the DDL change.
DDL modifications to the source table that change the source table column structure, such as adding or dropping a column, or changing the data type of an existing column, are maintained in the cdc.ddl_history table. These changes can be reported by using this stored procedure. Entries in cdc.ddl_history are made at the time the capture process reads the DDL transaction in the log.
The following example adds a column to the source table HumanResources.Employee and then runs the sys.sp_cdc_get_ddl_history stored procedure to report the DDL changes that apply to the source table associated with the capture instance HumanResources_Employee.
USE AdventureWorks2012; GO ALTER TABLE HumanResources.Employee ADD Test_Column int NULL; GO -- Pause 10 seconds to allow the event to be logged. WAITFOR DELAY '00:00:10'; GO EXECUTE sys.sp_cdc_get_ddl_history @capture_instance = 'HumanResources_Employee'; GO