開始使用系統建立版本的時態表Getting Started with system-versioned temporal tables

適用於: 是SQL Server 2016 與更新版本是Azure SQL Database否Azure Synapse Analytics (SQL DW)否平行處理資料倉儲APPLIES TO: YesSQL Server 2016 and later YesAzure SQL Database NoAzure Synapse Analytics (SQL DW) NoParallel Data Warehouse

根據您的案例,您可以建立新的系統建立版本的時態表,或修改現有的時態表,方法是將 temporal 屬性加入現有的資料表結構描述。Depending on your scenario, you can either create new system-versioned temporal tables or modify existing ones by adding temporal attributes to the existing table schema. 時態表中的資料修改時,系統就會建置應用程式和使用者看不到的版本歷程記錄。When the data in temporal table is modified, the system builds version history transparently to applications and end users. 如此一來,使用系統建立版本的時態表不需要對資料表的修改方法,或查詢資料的最新 (實際) 狀態的方式進行任何變更。As a result, working with system-versioned temporal tables does not require any change to the way table is modified or how the latest (actual) state of the data is queried.

除了一般資料操作語言 (DML) 和查詢,Temporal 也提供方便且簡單的方式,透過擴充的 Transact-SQL 語法,從資料歷程記錄中取得見解。In addition to regular DML and querying, temporal also provides convenient and easy ways to get insights from data history through extended Transact-SQL syntax. 每個系統建立版本的資料表中有一個指派的歷程記錄資料表,但是使用者完全看不到,除非他們想要藉由建立額外的索引,或選擇不同的儲存體選項,最佳化工作負載效能或儲存體使用量。Every system-versioned table has a history table assigned but it is completely transparent for the users unless they want to optimize workload performance or storage footprint by creating additional indexes or choosing different storage options.

下列圖表描述使用系統建立版本之時態表的一般工作流程︰開始使用時態表The following diagram depicts typical workflow with system-versioned temporal tables: Getting Started with Temporal

本主題分成以下 5 個子主題:This topic is divided into the following 5 subtopics:

後續步驟Next steps