Temporal syntax for ALTER TABLE allows you to create ANSI bitemporal tables from existing nontemporal tables, and combine the ALTER TABLE syntaxes for system-time and valid-time tables.
Adding valid time to the table involves these ALTER TABLE operations:
- Adding or altering the two DateTime columns that will serve as the beginning and ending bounds of the valid-time period
- Adding a valid-time derived period column to the table, and designating the derived column VALIDTIME
Adding system time to the table involves these ALTER TABLE operations:
- Adding a SYSTEM_TIME derived period column to the table by specifying the columns that will serve as the beginning and ending bounds of the system-time period.
- Adding or altering the columns that will serve as the beginning bound and ending bound of the system-time period. If these columns already exist in the table, special attributes must be added to them.
- Adding system versioning to the table
Syntax
There is no special syntax for altering tables to bitemporal tables. Use the combined special syntax that is discussed in ALTER TABLE (ANSI System-Time Table Form) and ALTER TABLE (ANSI Valid-Time Table Form).
The table must be altered to add a valid-time dimension prior to adding the system-time dimension, because ALTER TABLE operations on system-time tables are severely restricted.