[dbo].[LocalServiceEquipmentRequest]
CREATE TABLE [dbo].[LocalServiceEquipmentRequest]
(
[LocalServiceEquipmentRequestID] [int] NOT NULL IDENTITY(1, 1),
[LocalServiceFID] [int] NOT NULL,
[EquipmentTypeFID] [int] NOT NULL,
[Quantity] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LocalServiceEquipmentRequest] ADD CONSTRAINT [PK_LocalServiceEquipmentRequest] PRIMARY KEY CLUSTERED ([LocalServiceEquipmentRequestID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LocalServiceEquipmentRequest] ADD CONSTRAINT [IX_LocalServiceEquipmentRequest_LocalServiceFID_EquipmentTypeFID] UNIQUE NONCLUSTERED ([LocalServiceFID], [EquipmentTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LocalServiceEquipmentRequest] ADD CONSTRAINT [FK_LocalServiceEquipmentRequest_EquipmentTypeFID] FOREIGN KEY ([EquipmentTypeFID]) REFERENCES [dbo].[EqType] ([TypeNumber])
GO
ALTER TABLE [dbo].[LocalServiceEquipmentRequest] ADD CONSTRAINT [FK_LocalServiceEquipmentRequest_LocalServiceFID] FOREIGN KEY ([LocalServiceFID]) REFERENCES [dbo].[LocServ] ([PriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[LocalServiceEquipmentRequest] TO [MssExec]
GRANT INSERT ON [dbo].[LocalServiceEquipmentRequest] TO [MssExec]
GRANT DELETE ON [dbo].[LocalServiceEquipmentRequest] TO [MssExec]
GRANT UPDATE ON [dbo].[LocalServiceEquipmentRequest] TO [MssExec]
GO