[dbo].[StorageTrackBilling]
CREATE TABLE [dbo].[StorageTrackBilling]
(
[StorageTrackBillingPriKey] [int] NOT NULL IDENTITY(1, 1),
[StorageTypePriKey] [int] NOT NULL,
[BranchPriKey] [int] NOT NULL,
[LastBillFrom] [datetime] NOT NULL,
[LastBillTo] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageTrackBilling] ADD CONSTRAINT [PK_StorageTrackBilling] PRIMARY KEY NONCLUSTERED ([StorageTrackBillingPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageTrackBilling] ADD CONSTRAINT [FK_StorageTrackBilling_Branch] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[StorageTrackBilling] ADD CONSTRAINT [FK_StorageTrackBilling_StorageType] FOREIGN KEY ([StorageTypePriKey]) REFERENCES [dbo].[StorageType] ([StorageTypePriKey])
GO
GRANT SELECT ON [dbo].[StorageTrackBilling] TO [MssExec]
GRANT INSERT ON [dbo].[StorageTrackBilling] TO [MssExec]
GRANT DELETE ON [dbo].[StorageTrackBilling] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageTrackBilling] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a branch.', 'SCHEMA', N'dbo', 'TABLE', N'StorageTrackBilling', 'COLUMN', N'BranchPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Start date of the last billing period.', 'SCHEMA', N'dbo', 'TABLE', N'StorageTrackBilling', 'COLUMN', N'LastBillFrom'
GO
EXEC sp_addextendedproperty N'MS_Description', N'End date of the last billing period.', 'SCHEMA', N'dbo', 'TABLE', N'StorageTrackBilling', 'COLUMN', N'LastBillTo'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'StorageTrackBilling', 'COLUMN', N'StorageTrackBillingPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a storage type.', 'SCHEMA', N'dbo', 'TABLE', N'StorageTrackBilling', 'COLUMN', N'StorageTypePriKey'
GO