How can I find which records of `Data Warehouse` must be updated according to CDC captured changes?

StackOverflow https://stackoverflow.com/questions/22436801

Question

I use SQL Server 2012 for OLTP Database and created a Data Warehouse in SQL Server 2012.

I design Facts and Dimensions inside Data Warehouse with several Views.

Some of my Fact table are made by joinning several tables inside my view.

I use CDC (Change Data Capture) to get noticed of any OLTP changes and save these changes in a Stage Database and finally I have to update Data Warehouse based on above saved changes.

The question is how can I detect which records of my Data Warehouse have to be updated according to these saved changes by the CDC?

For more description :

I have SalesFact in my Data Warehouse that has one View like this

Select 
 Sum(T1.X),
 Sum(T2.Y),
 Sum(T3.Z),
 Sum(T4.W)
From T1
  Left join T2 On (....)
  Left join T3 On (....)
  Left join T4 On (....)
Group By T1.X,T2.Y,T3.Z,T4.W

Also I have 4 CDC Tables to save the OLTP changes as :

Create Table T1Change()

Create Table T2Change()

Create Table T3Change()

Create Table T4Change()

so, How can I find which records of Data Warehouse must be updated according to these changes ?

Était-ce utile?

La solution

I now understand from your further comments that your key is made of the very columns that change, and you have no durable key. I cant see how a "change" can be determined in this scenario.

I would abandon the entire CDC design, and truncate and fully refresh the destination table each time.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top