Chapter 9. Temporal tables
When you modify data in tables, normally you lose any trace of the premodified state of the rows. You can access only the current state. What if you need to be able to access historical states of the data? Perhaps you need these states for auditing, point-in-time analysis, comparing current states with older states, slowly changing dimensions (details of which you can find in the Wikipedia article at https://en.wikipedia.org/wiki/Slowly_changing_dimension), restoring an older state of rows because of accidental deletion or updating, and so on. You could roll your own customized solution based on triggers. Better yet, starting with Microsoft SQL Server 2016, you can use a built-in feature called system-versioned temporal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access