[dbo].[ReductionProfileDetail]
CREATE TABLE [dbo].[ReductionProfileDetail]
(
[ReductionProfileDetailID] [int] NOT NULL IDENTITY(1, 1),
[ReductionProfileFID] [int] NOT NULL,
[ReductionTemplateFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReductionProfileDetail] ADD CONSTRAINT [PK_ReductionProfileDetail] PRIMARY KEY CLUSTERED ([ReductionProfileDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReductionProfileDetail] ADD CONSTRAINT [IX_ReductionProfileDetail_ProfileTemplate] UNIQUE NONCLUSTERED ([ReductionProfileFID], [ReductionTemplateFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReductionProfileDetail] ADD CONSTRAINT [FK_ReductionProfileDetail_ReductionProfile] FOREIGN KEY ([ReductionProfileFID]) REFERENCES [dbo].[ReductionProfile] ([ReductionProfileID])
GO
ALTER TABLE [dbo].[ReductionProfileDetail] ADD CONSTRAINT [FK_ReductionProfileDetail_ReductionTemplateHeader] FOREIGN KEY ([ReductionTemplateFID]) REFERENCES [dbo].[ReductionTemplateHeader] ([ReductionTemplateID])
GO
GRANT SELECT ON [dbo].[ReductionProfileDetail] TO [MssExec]
GRANT INSERT ON [dbo].[ReductionProfileDetail] TO [MssExec]
GRANT DELETE ON [dbo].[ReductionProfileDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[ReductionProfileDetail] TO [MssExec]
GO