简体   繁体   中英

How to make SQl Server reimport data into CDC tables?

I have a SQL Server box with some CDC-enabled databases. I'd like to somehow make the rows from a source table to be automatcally imported again into the respective CDC table, so that they can be further shipped into a DW database. The rows from the CDC table have been purged because its retention period expired. Any idea how can it be done? Thanks in advance

I managed to force the CDC to reimport data by updating rows in the source table to some dummy values, then updating them back to the original values. This way the CDC picked up new transaction log entries. Of course for each original row 4 rows were generated in the CDC table, so this workaround may not be suitable for everyone, but it's just a matter of clearing out the redundant rows in a staging area - so it's OK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM