Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server 2016 (13.x) and later versions
Azure SQL Database
Azure SQL Managed Instance
SQL database in Microsoft Fabric
You can use partitioning on both the current and the history table independently. However, you can't use partitioning to change the data content without system-versioning.
Partitioning is an Enterprise edition feature in SQL Server 2016 (13.x) before Service Pack 1 and earlier versions. Partitioning is supported in all editions in SQL Server 2016 (13.x) with Service Pack 1, and later versions.
Partition temporal tables
This section describes how to use SWITCH IN and SWITCH OUT with temporal tables.
Current table
You can use SWITCH IN to the current table to help load and query data while SYSTEM_VERSIONING is ON.
SWITCH OUT isn't allowed while SYSTEM_VERSIONING is ON.
History table
You can run SWITCH OUT from the history table while SYSTEM_VERSIONING is ON, to purge history data that's no longer relevant.
SWITCH IN isn't allowed while SYSTEM_VERSIONING is ON, because it can invalidate temporal data consistency.
Related content
- Temporal tables
- Get started with system-versioned temporal tables
- Temporal table system consistency checks
- Temporal table considerations and limitations
- Temporal table security
- Manage retention of historical data in system-versioned temporal tables
- System-versioned temporal tables with memory-optimized tables
- Temporal table metadata views and functions