CREATE TABLE [dbo].[ReportGroupMap]
(
[ReportGroupMapID] [int] NOT NULL IDENTITY(1, 1),
[ReportFID] [int] NOT NULL,
[ReportGroupFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportGroupMap] ADD CONSTRAINT [PK_ReportGroupMap] PRIMARY KEY CLUSTERED ([ReportGroupMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportGroupMap] ADD CONSTRAINT [IX_ReportGroupMap_ReportFID] UNIQUE NONCLUSTERED ([ReportFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportGroupMap] ADD CONSTRAINT [FK_ReportGroupMap_Reports] FOREIGN KEY ([ReportFID]) REFERENCES [dbo].[Reports] ([Prikey])
GO
ALTER TABLE [dbo].[ReportGroupMap] ADD CONSTRAINT [FK_ReportGroupMap_ReportGroup] FOREIGN KEY ([ReportGroupFID]) REFERENCES [dbo].[ReportGroup] ([ReportGroupID])
GO
GRANT SELECT ON [dbo].[ReportGroupMap] TO [MssExec]
GRANT INSERT ON [dbo].[ReportGroupMap] TO [MssExec]
GRANT DELETE ON [dbo].[ReportGroupMap] TO [MssExec]
GRANT UPDATE ON [dbo].[ReportGroupMap] TO [MssExec]
GO