[dbo].[StorageRateMatrixXYBasis]
CREATE TABLE [dbo].[StorageRateMatrixXYBasis]
(
[StorageRateMatrixXYBasisID] [int] NOT NULL IDENTITY(1, 1),
[StorageItemsFID] [int] NOT NULL,
[RateMatrixFID] [int] NOT NULL,
[XRangeValue] [decimal] (12, 3) NULL,
[YRangeValue] [decimal] (12, 3) NULL,
[XBreakPoint] [decimal] (12, 3) NULL,
[YBreakPoint] [decimal] (12, 3) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageRateMatrixXYBasis] ADD CONSTRAINT [PK_StorageRateMatrixXYBasis] PRIMARY KEY CLUSTERED ([StorageRateMatrixXYBasisID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageRateMatrixXYBasis] ADD CONSTRAINT [IX_StorageRateMatrixXYBasis_StorageItems] UNIQUE NONCLUSTERED ([StorageItemsFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageRateMatrixXYBasis] ADD CONSTRAINT [FK_StorageRateMatrixXYBasis_RateMatrix] FOREIGN KEY ([RateMatrixFID]) REFERENCES [dbo].[RateMatrix] ([RateMatrixID])
GO
ALTER TABLE [dbo].[StorageRateMatrixXYBasis] ADD CONSTRAINT [FK_StorageRateMatrixXYBasis_StorageItems] FOREIGN KEY ([StorageItemsFID]) REFERENCES [dbo].[StorageItems] ([StorageItemsPriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[StorageRateMatrixXYBasis] TO [MssExec]
GRANT INSERT ON [dbo].[StorageRateMatrixXYBasis] TO [MssExec]
GRANT DELETE ON [dbo].[StorageRateMatrixXYBasis] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageRateMatrixXYBasis] TO [MssExec]
GO