How temporal tables work in SQL Server 2017

A system-versioned temporal table is implemented in SQL Server 2017 as a pair of tables: the current table containing the actual data, and the history table where only historical entries are stored. There are many limitations for both current and history tables. Here are limitations and considerations that you must take into account for the current table of a system-versioned temporal table:

  • It must have a primary key defined
  • It must have one PERIOD FOR SYSTEM_TIME defined with two DATETIME2 columns
  • Cannot be FILETABLE and cannot contain FILESTREAM data type
  • INSERT, UPDATE, and MERGE statements cannot reference and modify period columns; the start column is always set to system time, the end column ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.