1CREATE TABLE Department
2(
3 DeptID INT NOT NULL PRIMARY KEY CLUSTERED
4 , DeptName VARCHAR(50) NOT NULL
5 , ManagerID INT NULL
6 , ParentDeptID INT NULL
7 , SysStartTime DATETIME2 GENERATED ALWAYS AS ROW START NOT NULL
8 , SysEndTime DATETIME2 GENERATED ALWAYS AS ROW END NOT NULL
9 , PERIOD FOR SYSTEM_TIME (SysStartTime,SysEndTime)
10)
11WITH (SYSTEM_VERSIONING = ON);
12