[dbo].[StorageProcessing]
CREATE TABLE [dbo].[StorageProcessing]
(
[StorageProcessPriKey] [int] NOT NULL IDENTITY(1, 1),
[StoragePriKey] [int] NOT NULL,
[Source] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SourcePriKey] [int] NOT NULL,
[SessionID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Deferred] [smallint] NOT NULL CONSTRAINT [DF_StorageProcessing_Deferred] DEFAULT (0),
[StorageItemsPriKey] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageProcessing] ADD CONSTRAINT [PK_StorageProcessing] PRIMARY KEY NONCLUSTERED ([StorageProcessPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StorageProcessing_SessionID] ON [dbo].[StorageProcessing] ([SessionID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StorageProcessing] ADD CONSTRAINT [FK_StorageProcessing_StorageItems] FOREIGN KEY ([StorageItemsPriKey]) REFERENCES [dbo].[StorageItems] ([StorageItemsPriKey])
GO
ALTER TABLE [dbo].[StorageProcessing] ADD CONSTRAINT [FK_StorageProcessing_Storage] FOREIGN KEY ([StoragePriKey]) REFERENCES [dbo].[Storage] ([StoragePriKey])
GO
GRANT SELECT ON [dbo].[StorageProcessing] TO [MssExec]
GRANT INSERT ON [dbo].[StorageProcessing] TO [MssExec]
GRANT DELETE ON [dbo].[StorageProcessing] TO [MssExec]
GRANT UPDATE ON [dbo].[StorageProcessing] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'0 if the order is not deferred. 1 if the order is deferred.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'Deferred'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Session id for the storage order.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'SessionID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Source of the storage order.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'Source'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key of the source.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'SourcePriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a storage item.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'StorageItemsPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to a storage order.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'StoragePriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'StorageProcessing', 'COLUMN', N'StorageProcessPriKey'
GO