[dbo].[VanlineStatementStageErrorLog]
CREATE TABLE [dbo].[VanlineStatementStageErrorLog]
(
[VanlineStatementStageErrorLogID] [int] NOT NULL IDENTITY(1, 1),
[VanlineStatementStageHeaderFID] [int] NOT NULL,
[LoggedOn] [datetime] NOT NULL,
[ErrorCodeFID] [int] NOT NULL,
[OtherData] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VanlineStatementStageErrorLog] ADD CONSTRAINT [PK_VanlineStatementStageErrorLog] PRIMARY KEY CLUSTERED ([VanlineStatementStageErrorLogID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_[VanlineStatementStageErrorLog_Header] ON [dbo].[VanlineStatementStageErrorLog] ([VanlineStatementStageHeaderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VanlineStatementStageErrorLog] ADD CONSTRAINT [FK_VanlineStatementStageErrorLog_ErrorCode] FOREIGN KEY ([ErrorCodeFID]) REFERENCES [dbo].[ErrorCode] ([ECPriKey])
GO
ALTER TABLE [dbo].[VanlineStatementStageErrorLog] ADD CONSTRAINT [FK_VanlineStatementStageErrorLog_VanlineStatementStageHeader] FOREIGN KEY ([VanlineStatementStageHeaderFID]) REFERENCES [dbo].[VanlineStatementStageHeader] ([VanlineStatementStageHeaderID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[VanlineStatementStageErrorLog] TO [MssExec]
GRANT INSERT ON [dbo].[VanlineStatementStageErrorLog] TO [MssExec]
GRANT DELETE ON [dbo].[VanlineStatementStageErrorLog] TO [MssExec]
GRANT UPDATE ON [dbo].[VanlineStatementStageErrorLog] TO [MssExec]
GO