[dbo].[ReportProfileDetail]
CREATE TABLE [dbo].[ReportProfileDetail]
(
[RPDetailPriKey] [int] NOT NULL IDENTITY(1, 1),
[ReportProfilePriKey] [int] NOT NULL,
[ReportPriKey] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportProfileDetail] ADD CONSTRAINT [PK_ReportProfileDetail] PRIMARY KEY CLUSTERED ([RPDetailPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_ReportProfileDetail_ReportProfile_Report] ON [dbo].[ReportProfileDetail] ([ReportProfilePriKey], [ReportPriKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportProfileDetail] ADD CONSTRAINT [FK_ReportProfileDetail_Reports] FOREIGN KEY ([ReportPriKey]) REFERENCES [dbo].[Reports] ([Prikey])
GO
ALTER TABLE [dbo].[ReportProfileDetail] ADD CONSTRAINT [FK_ReportProfileDetail_ReportProfile] FOREIGN KEY ([ReportProfilePriKey]) REFERENCES [dbo].[ReportProfile] ([ReportProfilePriKey])
GO
GRANT SELECT ON [dbo].[ReportProfileDetail] TO [MssExec]
GRANT INSERT ON [dbo].[ReportProfileDetail] TO [MssExec]
GRANT DELETE ON [dbo].[ReportProfileDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[ReportProfileDetail] TO [MssExec]
GO