CREATE TABLE [dbo].[SplitStatement]
(
[SSPriKey] [int] NOT NULL IDENTITY(1, 1),
[SHPriKey] [int] NOT NULL,
[StatementDesc] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DateDownload] [datetime] NULL,
[DownLoadedBy] [int] NULL,
[DatePosted] [datetime] NULL,
[WhoPosted] [int] NULL,
[DateSplit] [datetime] NULL,
[SplitBy] [int] NULL,
[Amount] [money] NULL,
[Status] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ANPriKey] [int] NULL,
[DateEntered] [datetime] NULL,
[EnteredBy] [int] NULL,
[AgentPriKey] [int] NULL,
[IsClaimsBatch] [bit] NOT NULL CONSTRAINT [DF_SplitStatement_IsClaimsBatch] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [PK_SplitStatement] PRIMARY KEY CLUSTERED ([SSPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SplitStatement_DownLoadedBy] ON [dbo].[SplitStatement] ([DownLoadedBy]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SplitStatement_EnteredBy] ON [dbo].[SplitStatement] ([EnteredBy]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SplitStatement] ON [dbo].[SplitStatement] ([SHPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SplitStatement_SplitBy] ON [dbo].[SplitStatement] ([SplitBy]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SplitStatement_Status] ON [dbo].[SplitStatement] ([Status]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SplitStatement_WhoPosted] ON [dbo].[SplitStatement] ([WhoPosted]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_AGENT] FOREIGN KEY ([AgentPriKey]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_AccountingNote] FOREIGN KEY ([ANPriKey]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_Sysuser] FOREIGN KEY ([DownLoadedBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_Sysuser3] FOREIGN KEY ([EnteredBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_StatementHeader] FOREIGN KEY ([SHPriKey]) REFERENCES [dbo].[StatementHeader] ([SHPriKey])
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_Sysuser2] FOREIGN KEY ([SplitBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[SplitStatement] ADD CONSTRAINT [FK_SplitStatement_Sysuser1] FOREIGN KEY ([WhoPosted]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[SplitStatement] TO [MssExec]
GRANT INSERT ON [dbo].[SplitStatement] TO [MssExec]
GRANT DELETE ON [dbo].[SplitStatement] TO [MssExec]
GRANT UPDATE ON [dbo].[SplitStatement] TO [MssExec]
GO