CREATE TABLE [dbo].[RatePlans]
(
[RPPriKey] [int] NOT NULL IDENTITY(1, 1),
[RatePlanName] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsLocal] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VanLineCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsSelectable] [bit] NOT NULL CONSTRAINT [DF_RatePlans_IsSelectable] DEFAULT ((1)),
[PointToPointTypeFID] [int] NULL,
[RateEffectiveDateBasisFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RatePlans] ADD CONSTRAINT [PK_RatePlans] PRIMARY KEY CLUSTERED ([RPPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RatePlans] ADD CONSTRAINT [IX_Unique_Rate_Plan_Name] UNIQUE NONCLUSTERED ([RatePlanName]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RatePlans] ADD CONSTRAINT [FK_RatePlans_PointToPointType] FOREIGN KEY ([PointToPointTypeFID]) REFERENCES [dbo].[PointToPointType] ([PointToPointTypeID])
GO
ALTER TABLE [dbo].[RatePlans] ADD CONSTRAINT [FK_RatePlans_RateEffectiveDateBasis] FOREIGN KEY ([RateEffectiveDateBasisFID]) REFERENCES [dbo].[RateEffectiveDateBasis] ([RateEffectiveDateBasisID])
GO
GRANT SELECT ON [dbo].[RatePlans] TO [MssExec]
GRANT INSERT ON [dbo].[RatePlans] TO [MssExec]
GRANT DELETE ON [dbo].[RatePlans] TO [MssExec]
GRANT UPDATE ON [dbo].[RatePlans] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'The description of the rate plan.', 'SCHEMA', N'dbo', 'TABLE', N'RatePlans', 'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Flag indicating if the rate plan is for local. 1 for true, 0 for false.', 'SCHEMA', N'dbo', 'TABLE', N'RatePlans', 'COLUMN', N'IsLocal'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Determines if the rate plan can be selected through the application.', 'SCHEMA', N'dbo', 'TABLE', N'RatePlans', 'COLUMN', N'IsSelectable'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The name of the rate plan.', 'SCHEMA', N'dbo', 'TABLE', N'RatePlans', 'COLUMN', N'RatePlanName'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The primary key.', 'SCHEMA', N'dbo', 'TABLE', N'RatePlans', 'COLUMN', N'RPPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The van line code for the rate plan.', 'SCHEMA', N'dbo', 'TABLE', N'RatePlans', 'COLUMN', N'VanLineCode'
GO