Data manipulation in temporal tables

In this section, you will see what happens when data is inserted, updated, or deleted into/in/from a temporal table. Note that all manipulations will be done against the current table. The history table is protected; only the system can write to it.

Even members of the sysadmin server role cannot insert, update, or delete rows from a history table of a system-versioned temporal table in SQL Server 2017.

As an example, you will use the dbo.Product temporal table created in the previous section. Use this code to recreate the table:

USE WideWorldImporters; --remove existing temporal table if exists ALTER TABLE dbo.Product SET (SYSTEM_VERSIONING = OFF); ALTER TABLE dbo.Product DROP PERIOD FOR SYSTEM_TIME; ...

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.