CREATE TABLE [dbo].[EqType]
(
[TypeNumber] [int] NOT NULL IDENTITY(1, 1),
[Type] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ICPriKey] [int] NULL,
[AverageCost] [decimal] (14, 4) NULL,
[DispatchByQuantity] [bit] NOT NULL CONSTRAINT [DF_EqType_DispatchByQuantity] DEFAULT ((0)),
[CapacityBucketFID] [int] NULL,
[HoursAvailableDaily] [int] NULL,
[AutoDispatchQuantity] [bit] NOT NULL CONSTRAINT [DF_EqType_AutoDispatchQuantity] DEFAULT ((0)),
[Inactive] [bit] NOT NULL CONSTRAINT [DF_EqType_Inactive] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EqType] ADD CONSTRAINT [PK_EqType] PRIMARY KEY CLUSTERED ([TypeNumber]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_EqType_CapacityBucketFID] ON [dbo].[EqType] ([CapacityBucketFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[EqType] ADD CONSTRAINT [FK_EqType_CapacityBucket] FOREIGN KEY ([CapacityBucketFID]) REFERENCES [dbo].[CapacityBucket] ([CapacityBucketID])
GO
ALTER TABLE [dbo].[EqType] ADD CONSTRAINT [FK_EqType_ItemCode] FOREIGN KEY ([ICPriKey]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
GRANT SELECT ON [dbo].[EqType] TO [MssExec]
GRANT INSERT ON [dbo].[EqType] TO [MssExec]
GRANT DELETE ON [dbo].[EqType] TO [MssExec]
GRANT UPDATE ON [dbo].[EqType] TO [MssExec]
GO