CREATE TABLE [dbo].[Equip]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[VIN] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Descrip] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CubicFT] [float] NULL,
[Weight] [float] NULL,
[EqNo] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Make] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FuelID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Yr] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ActDate] [datetime] NULL,
[Model] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Dept] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Type] [int] NOT NULL,
[IsLongDist] [smallint] NULL,
[EQLevel] [int] NULL,
[Notes] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TractorNo] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TractorStatus] [int] NULL,
[EqStatus] [int] NOT NULL,
[IsLocal] [smallint] NULL,
[Length] [float] NULL,
[Height] [float] NULL,
[RegisteredOwner] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PurchasePrice] [money] NULL,
[CapacityBucketFID] [int] NULL,
[HoursAvailableDaily] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Equip] ADD CONSTRAINT [PK_EQUIP] PRIMARY KEY CLUSTERED ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Equip_CapacityBucketFID] ON [dbo].[Equip] ([CapacityBucketFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Equip] ADD CONSTRAINT [FK_Equip_CapacityBucket] FOREIGN KEY ([CapacityBucketFID]) REFERENCES [dbo].[CapacityBucket] ([CapacityBucketID])
GO
ALTER TABLE [dbo].[Equip] ADD CONSTRAINT [FK_Equip_EqStatus1] FOREIGN KEY ([EqStatus]) REFERENCES [dbo].[EqStatus] ([StatusNo])
GO
ALTER TABLE [dbo].[Equip] ADD CONSTRAINT [FK_Equip_EqStatus] FOREIGN KEY ([TractorStatus]) REFERENCES [dbo].[EqStatus] ([StatusNo])
GO
ALTER TABLE [dbo].[Equip] ADD CONSTRAINT [FK_EQUIP_EqType] FOREIGN KEY ([Type]) REFERENCES [dbo].[EqType] ([TypeNumber])
GO
GRANT SELECT ON [dbo].[Equip] TO [MssExec]
GRANT INSERT ON [dbo].[Equip] TO [MssExec]
GRANT DELETE ON [dbo].[Equip] TO [MssExec]
GRANT UPDATE ON [dbo].[Equip] TO [MssExec]
GO