CREATE TABLE [dbo].[StorageItemType]
(
[StorageItemTypePriKey] [int] NOT NULL IDENTITY(1, 1),
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ICPriKey] [int] NOT NULL,
[MinimumStorageFee] [money] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageItemType] ADD CONSTRAINT [PK_StorageItemType] PRIMARY KEY NONCLUSTERED ([StorageItemTypePriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageItemType] ADD CONSTRAINT [IX_StorageItemType_Description] UNIQUE NONCLUSTERED ([Description]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageItemType] ADD CONSTRAINT [FK_StorageItemType_ItemCode] FOREIGN KEY ([ICPriKey]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
GRANT SELECT ON [dbo].[StorageItemType] TO [MssExec]
GRANT INSERT ON [dbo].[StorageItemType] TO [MssExec]
GRANT DELETE ON [dbo].[StorageItemType] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageItemType] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Description of the item code.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItemType', 'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to an item code.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItemType', 'COLUMN', N'ICPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'StorageItemType', 'COLUMN', N'StorageItemTypePriKey'
GO