CREATE TABLE Vehicle(
ID INT IDENTITY(1,1) NOT NULL,
VendorID INT NOT NULL,
CampaignName VARCHAR(50) NOT NULL,
StartDate DATETIME NOT NULL ,
EndDate DATETIME NOT NULL ,
NationalAmount NUMERIC(4,2) NULL,
NationalOperator INT NULL,
InternationalAmount NUMERIC(4,2) NULL,
InternationalOperator INT NULL,
MakeRef VARCHAR(50) NOT NULL,
ModelRef VARCHAR(50) NULL,
DerivativeRef VARCHAR(50) NULL,
BodyStyleRef VARCHAR(50) NULL,
TransmissionID INT NULL,
ColourID INT NULL,
FuelTypeID INT NULL,
EngineSize INT NULL,
AgeFrom INT NULL,
AgeTo INT NULL,
AgeUnit INT NULL,
DamageAmountFrom INT NULL,
DamageAmountTo INT NULL,
VehicleSourceID INT NULL,
StockAgeFrom INT NULL,
StockAgeTo INT NULL,
CreatedBy INT NOT NULL,
ModifiedBy INT NULL,
CreatedDate DATETIME NOT NULL CONSTRAINT [Vehicle_CreateDate] DEFAULT (getdate()),
ModifiedDate DATETIME NULL,
IsActive BIT NOT NULL CONSTRAINT [Vehicle_IsActive] DEFAULT ((1))
CONSTRAINT [PK_Vehicle] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
-- Create the indexes
CREATE NONCLUSTERED INDEX [IX_Vehicle_VendorID] ON [dbo].[Vehicle]
(
VendorID ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
CREATE NONCLUSTERED INDEX [IX_Vehicle_VehicleSourceID] ON [dbo].[Vehicle]
(
VehicleSourceID ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
CREATE NONCLUSTERED INDEX [IX_VehicleCampaign_CreatedBy] ON [dbo].[Vehicle]
(
[CreatedBy] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
CREATE NONCLUSTERED INDEX [IX_Vehicle_ModifiedBy] ON [dbo].[Vehicle]
(
[ModifiedBy] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
GO
No comments:
Post a Comment