Temporal Tables (SQL Server 2016) Flashcards

1
Q

What does need a table to be considered as a temporal table?

A
  1. A primary key constraint.
  2. Two columns whose date type is DATETIME2 (one for hold the start time, and the other for hold the end time).

Once the table has the previous requirements, then during his creation/alter it needs:

  1. The start column needs to be marked with the clause GENERATED ALWAYS AS ROW START.
  2. The end column needs to be marked with the clause GENERATED ALWAYS AS ROW END.
  3. The declaration clause of the columns pair that denotes the start and end (the previous columns created): PERIOD FOR SYSTEM_TIME (, ).
  4. The table option SYSTEM_VERSIONING needs to be ON.
  5. A linked history table, which SQL Server can create in case it doesn’t exist.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly