none
Generating CDC rows as objects dynamically RRS feed

  • Question

  • I am writing an application to monitor Change Data Capture (CDC) tables in our database. what I would like to ideally do is get the list of CDC tables then read the records from each one and return a IDictionary> that contains the k/v pair of and IList of the records in the CDC table. (Or actually the records returned from a query using the cdc.fn_cdc_get_all_changes_... function). So, the result would the the ability for a client to add this monitoring my just enabling CDC on a new table and the app will pick them up automatically.

    the part I am struggling with is creating objects from the function results. These results contain several common columns then all the columns of the given table. I would like to not have to create a new type for each new table added and I believe (Maybe hallucinating?) I have seen a solution to this in the past. However, I am having difficulty finding it.

    I'm open to all suggestions even ones that don't fit my initial design as this is just in the earliest planning stages. The one main non-negotiable is the fact we need to be able to add monitoring of new CDC tables without creating new types, recompiling, redeploying, etc.

    Friday, June 1, 2012 9:53 PM

All replies

  • Hi rkbrown,

    Welcome to MSDN Forum.

    Based on this issue, my understanding is you want to query out all the records from all the Change Data Capture Tables, and use a Dictionary<string,List<T>> to retrieve the records in the client. The string is the table name and the List<T> stores all the rows of this table, but you don't want to create a new 'T', is it? If I understand incorrectly, please feel free to let me know.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us


    Monday, June 4, 2012 6:45 AM
    Moderator
  • Hi rkbrown,

    Have you solved the issue? I look forward to hearing from you. If you need further help, please feel free to let me know, I will be more than happy to be of assistance.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, June 6, 2012 3:56 AM
    Moderator