[dbo].[ReductionTemplateRevenueGroupMap]
CREATE TABLE [dbo].[ReductionTemplateRevenueGroupMap]
(
[ReductionTemplateRevenueGroupMapID] [int] NOT NULL IDENTITY(1, 1),
[ReductionTemplateHeaderFID] [int] NOT NULL,
[RevenueGroupFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReductionTemplateRevenueGroupMap] ADD CONSTRAINT [PK_ReductionTemplateRevenueGroupMap] PRIMARY KEY NONCLUSTERED ([ReductionTemplateRevenueGroupMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReductionTemplateRevenueGroupMap] ADD CONSTRAINT [IX_ReductionTemplateRevenueGroupMap_HeaderRevenueGroup] UNIQUE NONCLUSTERED ([ReductionTemplateHeaderFID], [RevenueGroupFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReductionTemplateRevenueGroupMap] ADD CONSTRAINT [FK_ReductionTemplateRevenueGroupMap_ReductionTemplateHeader] FOREIGN KEY ([ReductionTemplateHeaderFID]) REFERENCES [dbo].[ReductionTemplateHeader] ([ReductionTemplateID])
GO
ALTER TABLE [dbo].[ReductionTemplateRevenueGroupMap] ADD CONSTRAINT [FK_ReductionTemplateRevenueGroupMap_RevenueGroup] FOREIGN KEY ([RevenueGroupFID]) REFERENCES [dbo].[RevGroups] ([RGPriKey])
GO
GRANT SELECT ON [dbo].[ReductionTemplateRevenueGroupMap] TO [MssExec]
GRANT INSERT ON [dbo].[ReductionTemplateRevenueGroupMap] TO [MssExec]
GRANT DELETE ON [dbo].[ReductionTemplateRevenueGroupMap] TO [MssExec]
GRANT UPDATE ON [dbo].[ReductionTemplateRevenueGroupMap] TO [MssExec]
GO