CREATE TABLE [dbo].[RateMatrixRangeY]
(
[RateMatrixRangeYID] [int] NOT NULL IDENTITY(1, 1),
[RateMatrixFID] [int] NOT NULL,
[Minimum] [decimal] (12, 3) NOT NULL,
[Maximum] [decimal] (12, 3) NOT NULL,
[Note] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RateMatrixRangeY] ADD CONSTRAINT [CK_RateMatrixRangeY_ValidRange] CHECK (((1)=[dbo].[RateMatrixRangeYValidRange]([RateMatrixFID],[Minimum],[Maximum])))
GO
ALTER TABLE [dbo].[RateMatrixRangeY] ADD CONSTRAINT [PK_RateMatrixRangeY] PRIMARY KEY CLUSTERED ([RateMatrixRangeYID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_RateMatrixRangeY_RateMatrix] ON [dbo].[RateMatrixRangeY] ([RateMatrixFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RateMatrixRangeY] ADD CONSTRAINT [FK_RateMatrixRangeY_RateMatrix] FOREIGN KEY ([RateMatrixFID]) REFERENCES [dbo].[RateMatrix] ([RateMatrixID])
GO
GRANT SELECT ON [dbo].[RateMatrixRangeY] TO [MssExec]
GRANT INSERT ON [dbo].[RateMatrixRangeY] TO [MssExec]
GRANT DELETE ON [dbo].[RateMatrixRangeY] TO [MssExec]
GRANT UPDATE ON [dbo].[RateMatrixRangeY] TO [MssExec]
GO