CREATE TABLE [dbo].[ConsolidationProcessStatus]
(
[AccountID] [int] NOT NULL,
[StartDate] [datetime] NULL,
[EndDate] [datetime] NULL,
[CurrentStage] [smallint] NULL,
[Consolidated] [bit] NOT NULL CONSTRAINT [DF_ConsolidationProcessStatus_Consolidated] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ConsolidationProcessStatus] ADD CONSTRAINT [PK_ConsolidationProcessStatus_AccountID] PRIMARY KEY CLUSTERED ([AccountID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ConsolidationProcessStatus] ADD CONSTRAINT [FK_ConsolidationProcessStatus_AccountID_Account_AccountID] FOREIGN KEY ([AccountID]) REFERENCES [dbo].[Account] ([AccountID]) ON DELETE CASCADE
GO
EXEC sp_addextendedproperty N'MS_Description', N'One value from DataValuesTypes that represents the current values being processed', 'SCHEMA', N'dbo', 'TABLE', N'ConsolidationProcessStatus', 'COLUMN', N'CurrentStage'
GO