Converting non-temporal tables to temporal tables

In SQL Server 2017, you can create temporal tables from scratch, but you can also alter an existing table and add attributes to it to convert it to a system-versioned temporal table. All you need to do is to add period columns, define the SYSTEM_TIME period on them, and set the temporal attribute. In this section, for example, you will convert the Department table from the AdventureWorks2017 database into a temporal table. The following screenshot shows the table's content:

Data in the HumanResources.Department table

You can see that the table has one column representing temporality. The

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.