CREATE TABLE [dbo].[BATErrorLog]
(
[BATErrorPriKey] [int] NOT NULL IDENTITY(1, 1),
[Source] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SourcePriKey] [int] NULL,
[ECPriKey] [int] NULL,
[Object] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ObjectPriKey] [int] 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,
[SessionID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BATErrorLog] ADD CONSTRAINT [PK_BATErrorLog] PRIMARY KEY CLUSTERED ([BATErrorPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BATErrorLog] ADD CONSTRAINT [FK_BATErrorLog_ErrorCode] FOREIGN KEY ([ECPriKey]) REFERENCES [dbo].[ErrorCode] ([ECPriKey])
GO
GRANT SELECT ON [dbo].[BATErrorLog] TO [MssExec]
GRANT INSERT ON [dbo].[BATErrorLog] TO [MssExec]
GRANT DELETE ON [dbo].[BATErrorLog] TO [MssExec]
GRANT UPDATE ON [dbo].[BATErrorLog] TO [MssExec]
GO