CREATE TABLE [dbo].[ClaimErrorLog]
(
[ClaimErrorLogID] [int] NOT NULL IDENTITY(1, 1),
[SessionID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ClaimID] [int] NULL,
[Source] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SourceID] [int] NULL,
[Object] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ObjectID] [int] NULL,
[ECPriKey] [int] NOT NULL,
[Param1] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Param2] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Param3] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Param4] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Param5] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimErrorLog] ADD CONSTRAINT [PK_ClaimErrorLog] PRIMARY KEY NONCLUSTERED ([ClaimErrorLogID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_ClaimErrorLog_SessionID] ON [dbo].[ClaimErrorLog] ([SessionID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ClaimErrorLog] ADD CONSTRAINT [FK_ClaimErrorLog_Claim] FOREIGN KEY ([ClaimID]) REFERENCES [dbo].[Claim] ([ClaimID])
GO
ALTER TABLE [dbo].[ClaimErrorLog] ADD CONSTRAINT [FK_ClaimErrorLog_ErrorCode] FOREIGN KEY ([ECPriKey]) REFERENCES [dbo].[ErrorCode] ([ECPriKey])
GO
GRANT SELECT ON [dbo].[ClaimErrorLog] TO [MssExec]
GRANT INSERT ON [dbo].[ClaimErrorLog] TO [MssExec]
GRANT DELETE ON [dbo].[ClaimErrorLog] TO [MssExec]
GRANT UPDATE ON [dbo].[ClaimErrorLog] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key.', 'SCHEMA', N'dbo', 'TABLE', N'ClaimErrorLog', 'COLUMN', N'ClaimErrorLogID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key an order.', 'SCHEMA', N'dbo', 'TABLE', N'ClaimErrorLog', 'COLUMN', N'ClaimID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key to an error code.', 'SCHEMA', N'dbo', 'TABLE', N'ClaimErrorLog', 'COLUMN', N'ECPriKey'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Storage session the error occurred. ', 'SCHEMA', N'dbo', 'TABLE', N'ClaimErrorLog', 'COLUMN', N'SessionID'
GO