[dbo].[StatementGLAllocation]
CREATE TABLE [dbo].[StatementGLAllocation]
(
[StatementGLAllocationID] [int] NOT NULL IDENTITY(1, 1),
[SDPriKey] [int] NOT NULL,
[SDDPriKey] [int] NULL,
[BranchPriKey] [int] NOT NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Amount] [money] NULL CONSTRAINT [DF_StatementGLAllocation_Amount] DEFAULT (0),
[DivisionFID] [int] NULL,
[GLAccountNumber] [varchar] (66) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StatementGLAllocation] ADD CONSTRAINT [PK_StatementGLAllocation] PRIMARY KEY CLUSTERED ([StatementGLAllocationID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementGLAllocation_SDPriKey] ON [dbo].[StatementGLAllocation] ([SDPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StatementGLAllocation] ADD CONSTRAINT [FK_StatementGLAllocation_Branch] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[StatementGLAllocation] ADD CONSTRAINT [FK_StatementGLAllocation_Division] FOREIGN KEY ([DivisionFID]) REFERENCES [dbo].[Division] ([DivisionID])
GO
ALTER TABLE [dbo].[StatementGLAllocation] ADD CONSTRAINT [FK_StatementGLAllocation_StatementDetailDist] FOREIGN KEY ([SDDPriKey]) REFERENCES [dbo].[StatementDetailDist] ([SDDPriKey])
GO
ALTER TABLE [dbo].[StatementGLAllocation] ADD CONSTRAINT [FK_StatementGLAllocation_StatementDetail] FOREIGN KEY ([SDPriKey]) REFERENCES [dbo].[StatementDetail] ([SDPriKey])
GO
GRANT SELECT ON [dbo].[StatementGLAllocation] TO [MssExec]
GRANT INSERT ON [dbo].[StatementGLAllocation] TO [MssExec]
GRANT DELETE ON [dbo].[StatementGLAllocation] TO [MssExec]
GRANT UPDATE ON [dbo].[StatementGLAllocation] TO [MssExec]
GO