CREATE TABLE [dbo].[StorageType]
(
[StorageTypePriKey] [int] NOT NULL IDENTITY(1, 1),
[StorageTypeDescription] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsSIT] [bit] NOT NULL,
[StorageCalculationTypePriKey] [int] NOT NULL,
[ShortDescription] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_StorageType_ShortDescription] DEFAULT ('')
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageType] ADD CONSTRAINT [PK_StorageType] PRIMARY KEY NONCLUSTERED ([StorageTypePriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageType] ADD CONSTRAINT [IX_StorageType_Description] UNIQUE NONCLUSTERED ([StorageTypeDescription]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageType] ADD CONSTRAINT [FK_StorageType_StorageCalculationType] FOREIGN KEY ([StorageCalculationTypePriKey]) REFERENCES [dbo].[StorageCalculationType] ([StorageCalculationTypePriKey])
GO
GRANT SELECT ON [dbo].[StorageType] TO [MssExec]
GRANT INSERT ON [dbo].[StorageType] TO [MssExec]
GRANT DELETE ON [dbo].[StorageType] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageType] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'0 if the storage type is not SIT. 1 if it is SIT.', 'SCHEMA', N'dbo', 'TABLE', N'StorageType', 'COLUMN', N'IsSIT'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Brief description of the storage type.', 'SCHEMA', N'dbo', 'TABLE', N'StorageType', 'COLUMN', N'ShortDescription'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a storage calculation type.', 'SCHEMA', N'dbo', 'TABLE', N'StorageType', 'COLUMN', N'StorageCalculationTypePriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Description of the storage type.', 'SCHEMA', N'dbo', 'TABLE', N'StorageType', 'COLUMN', N'StorageTypeDescription'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'StorageType', 'COLUMN', N'StorageTypePriKey'
GO