Created
October 10, 2017 17:04
-
-
Save tdmitch/54cbe0e90f8c7170e678ccc8bd67fda4 to your computer and use it in GitHub Desktop.
This file contains 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
/* Create base table */ | |
CREATE TABLE [dbo].[Customers]( | |
[CustomerKey] INT NOT NULL IDENTITY(1,1), | |
[CustomerID] INT NOT NULL, | |
[CustomerName] VARCHAR(100) NOT NULL, | |
[CustomerCategory] VARCHAR(50) NULL, | |
[PrimaryContactPersonID] INT NOT NULL, | |
[PostalCityID] INT NOT NULL, | |
[CreditLimit] DECIMAL(18, 2) NULL, | |
[AccountOpenedDate] DATE NOT NULL, | |
[StandardDiscountPercentage] DECIMAL(18, 3) NOT NULL, | |
[IsStatementSent] BIT NOT NULL, | |
[IsOnCreditHold] BIT NOT NULL, | |
[PaymentDays] INT NOT NULL, | |
[PhoneNumber] VARCHAR(20) NOT NULL, | |
[FaxNumber] VARCHAR(20) NOT NULL, | |
[WebsiteURL] VARCHAR(256) NOT NULL, | |
[Address] VARCHAR(60) NOT NULL, | |
[Address2] VARCHAR(60) NULL, | |
[PostalCode] VARCHAR(10) NOT NULL, | |
ValidFrom DATETIME2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL , | |
ValidTo DATETIME2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL , | |
PERIOD FOR SYSTEM_TIME (ValidFrom, ValidTo), | |
CONSTRAINT PK_Customers PRIMARY KEY (CustomerKey) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment