
/* Code Fragment 9.5 Create a temporally-partitioned transaction-time state table. */

CREATE TABLE P_TT_PAST
(
	PROJECTION_ID INT NOT NULL,
	PROJECTION_NAME CHAR(10),
	PROJECTION_TYPE INT,
	SPHEROID_CODE INT,
	PROJECTION_UOM INT,
	ZONE_CODE INT,
	Start_Date DATETIME NOT NULL,
	Stop_Date DATETIME,
	PRIMARY KEY (PROJECTION_ID, Start_Date)
)

CREATE TABLE P_TT_CURRENT
(
	PROJECTION_ID INT NOT NULL,
	PROJECTION_NAME CHAR(10),
	PROJECTION_TYPE INT,
	SPHEROID_CODE INT,
	PROJECTION_UOM INT,
	ZONE_CODE INT,
	Start_Date DATETIME DEFAULT GETDATE()
	PRIMARY KEY (PROJECTION_ID)
)
