[dbo].[HtmlLetterReportProfileMap]
CREATE TABLE [dbo].[HtmlLetterReportProfileMap]
(
[HtmlLetterReportProfileMapID] [int] NOT NULL IDENTITY(1, 1),
[HtmlLetterFID] [int] NOT NULL,
[ReportProfileFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[HtmlLetterReportProfileMap] ADD CONSTRAINT [PK_HtmlLetterReportProfileMap] PRIMARY KEY CLUSTERED ([HtmlLetterReportProfileMapID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_HtmlLetterReportProfileMap_HtmlLetterFID_ReportProfileFID] ON [dbo].[HtmlLetterReportProfileMap] ([HtmlLetterFID], [ReportProfileFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_HtmlLetterReportProfileMap_ReportProfileFID] ON [dbo].[HtmlLetterReportProfileMap] ([ReportProfileFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[HtmlLetterReportProfileMap] ADD CONSTRAINT [FK_HtmlLetterReportProfileMap_HtmlLetter] FOREIGN KEY ([HtmlLetterFID]) REFERENCES [dbo].[HtmlLetter] ([HtmlLetterID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[HtmlLetterReportProfileMap] ADD CONSTRAINT [FK_HtmlLetterReportProfileMap_ReportProfile] FOREIGN KEY ([ReportProfileFID]) REFERENCES [dbo].[ReportProfile] ([ReportProfilePriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[HtmlLetterReportProfileMap] TO [MssExec]
GRANT INSERT ON [dbo].[HtmlLetterReportProfileMap] TO [MssExec]
GRANT DELETE ON [dbo].[HtmlLetterReportProfileMap] TO [MssExec]
GRANT UPDATE ON [dbo].[HtmlLetterReportProfileMap] TO [MssExec]
GO