[dbo].[QuoteOperationalPlanMap]
CREATE TABLE [dbo].[QuoteOperationalPlanMap]
(
[QuoteOperationalPlanMapID] [int] NOT NULL IDENTITY(1, 1),
[QuoteHeaderFID] [int] NOT NULL,
[OperationalPlanFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteOperationalPlanMap] ADD CONSTRAINT [PK_QuoteOperationalPlanMap] PRIMARY KEY NONCLUSTERED ([QuoteOperationalPlanMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteOperationalPlanMap] ADD CONSTRAINT [IX_QuoteOperationalPlanMap_OnlyOneHeaderPlan] UNIQUE NONCLUSTERED ([QuoteHeaderFID], [OperationalPlanFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteOperationalPlanMap] ADD CONSTRAINT [FK_QuoteOperationalPlanMap_OperationalPlan] FOREIGN KEY ([OperationalPlanFID]) REFERENCES [dbo].[OperationalPlan] ([OperationalPlanID])
GO
ALTER TABLE [dbo].[QuoteOperationalPlanMap] ADD CONSTRAINT [FK_QuoteOperationalPlanMap_QuoteHeader] FOREIGN KEY ([QuoteHeaderFID]) REFERENCES [dbo].[QuoteHeader] ([QuoteHeaderID])
GO
GRANT SELECT ON [dbo].[QuoteOperationalPlanMap] TO [MssExec]
GRANT INSERT ON [dbo].[QuoteOperationalPlanMap] TO [MssExec]
GRANT DELETE ON [dbo].[QuoteOperationalPlanMap] TO [MssExec]
GRANT UPDATE ON [dbo].[QuoteOperationalPlanMap] TO [MssExec]
GO