Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:49:03+00:00 2026-06-09T16:49:03+00:00

I am currently exploring Change Data Capture as an option to store temporal databases.

  • 0

I am currently exploring Change Data Capture as an option to store temporal databases. It is great because it stores only the deltas and seems like it may solve my problem. When I enabled CDC, a bunch of tables appeared under System Tables.

When querying cdc.dbo_MyTable, I am able to see all the changes that took place on the table. Now, how would I construct a historical view? For instance, if I wanted to see the state of my table as of a particular date, how would I go about doing that? Is that even possible?

It looks I need to take the log and start applying it over my original table but I was wondering if there is a built-in way of doing this. Any suggestions?

Some of the use cases I am looking at:

  • Know the state of the graph at a particular point in time
  • Given two graphs at different times, know the set of links that are different (this can probably be obtained using an EXCEPT clause after constructing the tables)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:49:05+00:00Added an answer on June 9, 2026 at 4:49 pm

    it’s possible, but not with a built-in way i’m a afraid. You would have to reconstruct the timeline by hand.

    Given that the change-tracking tables offer the tran_end_time, which is the time that the value of the property should be perceived as persisted, you would have to make a query that fetches all the distinct periods of table states, join on the tracked property changes and then pivot (to have a presentation in the same form as the table). Don’t forget to union with the table state itself to obtain the values that have not been changed/tracked for completeness.

    The final result, simplified, should look like

    RN PK PropA   PropB   FromDate          ToDate
    1  1  'Ver1'  'Ver1'  2012-01-01 09:00  2012-01-02 08:00
    2  1  'Ver1'  'Ver2'  2012-01-02 08:00  2012-01-03 07:00
    3  1  'Ver2'  'Ver2'  2012-01-03 07:00  *getdate()*
    4  2  'Ver1'  'Ver1'  2012-01-01 05:00  2012-01-02 06:00
    5  2  'Ver1'  'Ver2'  2012-01-02 06:00  2012-01-03 01:00
    6  2  'Ver2'  'Ver2'  2012-01-03 01:00  *getdate()*
    

    note that the getdate() is valid if the row wasn’t deleted in which case it should be substituted with the deletion date

    EDIT, for the 2 use cases.
    The first point is easily addressed it’s a matter of constructing the temporal object graph and then filtering:

    declare @pointInTime datetime = '20120102 10:00';
    select * from Reconstructed_TG where FromDate <= @pointInTime and @pointInTime < ToDate
    

    the second point, can be generated easily with the EXCEPT clause, as you point out.
    given the above query:

    declare @pointInTimeA datetime = '20120102 10:00';
    declare @pointInTimeB datetime = '20120103 01:00';
    select * from Reconstructed_TG where FromDate <= @pointInTimeA and @pointInTimeA < ToDate
    EXCEPT
    select * from Reconstructed_TG where FromDate <= @pointInTimeB and @pointInTimeB < ToDate
    

    yet the except clause only presents the rows that have at least one different column value; i don’t know if that information is really meaningful to the human eye. Depending on your needs a query that works directly on the cdc data may be more appropriate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently exploring interfacing C and R (using R's .Call for speed). I've only
I am currently exploring the specification of the Digital Mars D language, and am
I'm currently exploring the possibility of integrating MYOB Exo Business (Exonet) to a shopping
I'm currently exploring powershell capabilities, but I have encountered a problem that I have
We currently have a system that displays a page tabular data on the screen
I am currently exploring a bug in the template used on http://www.ecovivo.be/rubriek/food . Problem:
Greetings, I am currently exploring some extreme programming and try to stick as much
i'm currently exploring jQuery's plugin authoring and: var methods = { init : function(options)
I am currently exploring TPL and i am wondering if the following scenario is
I am currently exploring the possibilities of the MongoEngine object document mapper. What is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.