I have Change Data Capture enabled and working fine. The question that I have is how do I query the data to show users what changes occurred.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
You use built-in table-valued functions (TVFs) as described in Books Online : Using Change Data (MSDN).
First you need to find the LSNs you want to use to filter the ranges you want to query. These LSNs will represent points in the log which you can correlate to datetime values. You can do this using sys.fn_cdc_map_time_to_lsn. Let's say you want to report on all the change data captured today: