ALTER TABLE ... SET (SYSTEM_VERSIONING)
toggles system-versioning
What changes
- Input
- table and history table definitions
- Output or change
- temporal link on or off
Syntax at a glance
ALTER TABLE table SET ( SYSTEM_VERSIONING = { OFF | ON [ ( HISTORY_TABLE = schema.table [ , DATA_CONSISTENCY_CHECK = { ON | OFF } ] ) ] } )
Work example
A temporal table needs a planned history-table or versioning state change.
Check active writers, history retention, period columns, consistency, and the gap in historical capture.
Check your work Versioning is restored and an AS OF query returns the expected lab history.
Open Microsoft Learn for full syntax, permissions, and details for your version.