[dbo].[StorageBillingCycleType]
CREATE TABLE [dbo].[StorageBillingCycleType]
(
[BillingCyclePriKey] [int] NOT NULL IDENTITY(1, 1),
[BillingCycleDescription] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BillingCycleDays] [int] NOT NULL CONSTRAINT [DF_StorageBillingCycleType_BillingCycleDays] DEFAULT (0),
[StorageProRatingFID] [int] NULL,
[IsArrears] [bit] NOT NULL CONSTRAINT [DF_StorageBillingCycleType_IsArrears] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageBillingCycleType] ADD CONSTRAINT [PK_StorageBillingCycleType] PRIMARY KEY NONCLUSTERED ([BillingCyclePriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageBillingCycleType] ADD CONSTRAINT [IX_StorageBillingCycleType_Description] UNIQUE NONCLUSTERED ([BillingCycleDescription]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageBillingCycleType] ADD CONSTRAINT [FK_StorageBillingCycleType_StorageProRating] FOREIGN KEY ([StorageProRatingFID]) REFERENCES [dbo].[StorageProRating] ([StorageProRatingID])
GO
GRANT SELECT ON [dbo].[StorageBillingCycleType] TO [MssExec]
GRANT INSERT ON [dbo].[StorageBillingCycleType] TO [MssExec]
GRANT DELETE ON [dbo].[StorageBillingCycleType] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageBillingCycleType] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Number of days in the billing cycle.', 'SCHEMA', N'dbo', 'TABLE', N'StorageBillingCycleType', 'COLUMN', N'BillingCycleDays'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Description of the billing cycle.', 'SCHEMA', N'dbo', 'TABLE', N'StorageBillingCycleType', 'COLUMN', N'BillingCycleDescription'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Flags a billing cycle to bill in arrears.', 'SCHEMA', N'dbo', 'TABLE', N'StorageBillingCycleType', 'COLUMN', N'IsArrears'
GO