Sql Server Change Data Capture: Preserving history when adding columns?

孤街醉人 提交于 2019-12-04 05:52:52

Rich,

The best method to preserve such data is to create a staging persisted table to capture the _CT table data periodically. Knowing that cdc data generally has a short shelf-life prior to be consumed by the endpoint (warehouse/data mart, etc.) you can ensure that any changes are completed within a maintenance window at which time the _CT table data is copied off into staging prior to the changes being implemented.

The one aspect to consider in this is that once the _CT schema has been changed (by adding or removing one or more columns) the process used to pull that data out into the endpoint must also be updated.

To overcome this we implemented a script store that stores the intended schema of the staging table (used between _CT and endpoint) and once the changes are implemented on the client DB, then we move the data from staging into endpoint and update the staging schema.

Hopefully this will provide food for thought.

I think you'd have to write out the lsn records also and then bring them back into the lsntimemapping table.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!