This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Drop and create our temporal and historical tables | |
IF OBJECT_ID('dbo.CarInventory', 'U') IS NOT NULL | |
BEGIN | |
-- When deleting a temporal table, we need to first turn versioning off | |
ALTER TABLE dbo.CarInventory SET ( SYSTEM_VERSIONING = OFF ) | |
DROP TABLE dbo.CarInventory | |
DROP TABLE dbo.CarInventoryHistory | |
END; | |
CREATE TABLE CarInventory | |
( |