CREATE TABLE [dbo].[LSCrates]
(
[LSCPriKey] [int] NOT NULL IDENTITY(1, 1),
[LSPriKey] [int] NOT NULL,
[Quantity] [int] NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Height] [float] NULL,
[Width] [float] NULL,
[Length] [float] NULL,
[CubicFeet] [float] NULL,
[CrateItemCodeMapFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LSCrates] ADD CONSTRAINT [PK_LSCRATES] PRIMARY KEY CLUSTERED ([LSCPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LSCrates_CrateItemCodeMap] ON [dbo].[LSCrates] ([CrateItemCodeMapFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_LSCrates_LSPriKey] ON [dbo].[LSCrates] ([LSPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LSCrates] ADD CONSTRAINT [FK_LSCrates_CrateItemCodeMap] FOREIGN KEY ([CrateItemCodeMapFID]) REFERENCES [dbo].[CrateItemCodeMap] ([CrateItemCodeMapID])
GO
ALTER TABLE [dbo].[LSCrates] ADD CONSTRAINT [FK_LSCRATES_LOCSERV] FOREIGN KEY ([LSPriKey]) REFERENCES [dbo].[LocServ] ([PriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[LSCrates] TO [MssExec]
GRANT INSERT ON [dbo].[LSCrates] TO [MssExec]
GRANT DELETE ON [dbo].[LSCrates] TO [MssExec]
GRANT UPDATE ON [dbo].[LSCrates] TO [MssExec]
GO