Home Forums Data Warehousing Strategies and Ideas Using Change Data Capture (CDC) for Extracting Changed Data on Multiple Tables in a Single Query RE: Using Change Data Capture (CDC) for Extracting Changed Data on Multiple Tables in a Single Query

  • You should design your process in such a way that it processes the effects of only one tables' changes at a time. So if your DWH table is the result of joining 3 tables, you should have 3 separate 'feeds', each processing only the changes from one of these source tables.

    For example, your Production.ProductSubcategory and Production.ProductCategory are likely to have very little changes. Chances are that they will not have changed within the last 3 days (the default retention period for cdc) at the time a new product is created. i.e. If you do an inner join between the 3 function's results, you'll likely end up with an empty result set: the cdc.fn_cdc_get_net_changes...() functions only return latest changes, not the entire source table's contents. If you split up each table's changes into 3 separate 'feeds', each of these feeds must reflect the effect on the DWH table of the changes made in the one source table.



    Posting Data Etiquette - Jeff Moden[/url]
    Posting Performance Based Questions - Gail Shaw[/url]
    Hidden RBAR - Jeff Moden[/url]
    Cross Tabs and Pivots - Jeff Moden[/url]
    Catch-all queries - Gail Shaw[/url]


    If you don't have time to do it right, when will you have time to do it over?