Comparisons with temporal and history tables

You can compare temporal and history table pairs.

The following table shows the compare results for various sources and targets. B1 and B2 are regular tables that have corresponding temporal and history tables.

Table 1. Temporal-history table compare results
Source Target Expected result
None Temporal table (B1) and history table (B2)

Temporal table (B1) is dropped.

History table (B2) will be dropped by dropping the history-enabled table.
Table B1 Temporal table (B1) and history table (B2)

Table B1 is compared.

ALTER TABLE TEMPORAL TABLE DROP VERSIONING is generated.
Table B2 Temporal table (B1) and history table (B2) ALTER TABLE B1 DROP VERSIONING is generated.

Table B1 is dropped.

Table B2 is compared.

Temporal table and history table (no temporal-history relationship between these two tables) Temporal table (B1) and history table (B2)

Table B1 and B2 are compared.

ALTER TABLE B1 DROP VERSIONING is generated.
Temporal table (B1) and history table (B2) None

Table B1 and B2 are added.

ALTER TABLE B1 ADD VERSIONING USE B2 is generated.
Temporal table (B1) and history table (B2) Table B1

Table B1 is compared.

History table (B2) is added.

ALTER TABLE B1 ADD VERSIONING USE B2 is generated.
Temporal table (B1) and history table (B2) Table B2

Table B1 is added.

Table B2 is compared.

ALTER TABLE B1 ADD VERSIONING USE B2 is generated.

Temporal table (B1) and history table (B2)

Table B2

Table B2

(no temporal-history relationship between these two tables)

Table B1 is compared

Table B2 is compared.

ALTER TABLE B1 ADD VERSIONING USE B2 is generated.