[dbo].[RevenueRatingImportHeaderReduction]
CREATE TABLE [dbo].[RevenueRatingImportHeaderReduction]
(
[RevenueRatingImportHeaderReductionID] [int] NOT NULL IDENTITY(1, 1),
[RevenueRatingImportHeaderFID] [int] NOT NULL,
[ReductionTypeFID] [int] NOT NULL,
[ReductionBasisFID] [int] NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Percentage] [decimal] (10, 3) NULL,
[ReductionAmount] [money] NOT NULL CONSTRAINT [DF_RevenueRatingImportHeaderReduction_ReductionAmount] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportHeaderReduction] ADD CONSTRAINT [PK_RevenueRatingImportHeaderReduction] PRIMARY KEY NONCLUSTERED ([RevenueRatingImportHeaderReductionID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_RevenueRatingImportHeaderReduction_RevenueReatingImportHeaderFID] ON [dbo].[RevenueRatingImportHeaderReduction] ([RevenueRatingImportHeaderFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportHeaderReduction] ADD CONSTRAINT [FK_RevenueRatingImportHeaderReduction_ReductionBasis] FOREIGN KEY ([ReductionBasisFID]) REFERENCES [dbo].[ReductionBasis] ([ReductionBasisID])
GO
ALTER TABLE [dbo].[RevenueRatingImportHeaderReduction] ADD CONSTRAINT [FK_RevenueRatingImportHeaderReduction_ReductionType] FOREIGN KEY ([ReductionTypeFID]) REFERENCES [dbo].[ReductionType] ([ReductionTypeID])
GO
ALTER TABLE [dbo].[RevenueRatingImportHeaderReduction] ADD CONSTRAINT [FK_RevenueRatingImportHeaderReduction_RevenueRatingImportHeader] FOREIGN KEY ([RevenueRatingImportHeaderFID]) REFERENCES [dbo].[RevenueRatingImportHeader] ([RevenueRatingImportHeaderID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[RevenueRatingImportHeaderReduction] TO [MssExec]
GRANT INSERT ON [dbo].[RevenueRatingImportHeaderReduction] TO [MssExec]
GRANT DELETE ON [dbo].[RevenueRatingImportHeaderReduction] TO [MssExec]
GRANT UPDATE ON [dbo].[RevenueRatingImportHeaderReduction] TO [MssExec]
GO