
[dbo].[BcTransactionBatchItem]
CREATE TABLE [dbo].[BcTransactionBatchItem]
(
[BcTransactionBatchItemId] [int] NOT NULL IDENTITY(1, 1),
[BcTransactionBatchFid] [int] NOT NULL,
[AcctTransactionFid] [int] NOT NULL,
[ProjectCode] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ProjectDimensionValueBcId] [uniqueidentifier] NULL,
[NominalAccountBcId] [uniqueidentifier] NOT NULL,
[OpposingAccountBcId] [uniqueidentifier] NOT NULL,
[CustomerBcId] [uniqueidentifier] NULL,
[VendorBcId] [uniqueidentifier] NULL,
[MoveTypeDimensionValueBcId] [uniqueidentifier] NULL,
[NominalBranchDimensionValueBcId] [uniqueidentifier] NOT NULL,
[OpposingBranchDimensionValueBcId] [uniqueidentifier] NOT NULL,
[NominalDivisionDimensionValueBcId] [uniqueidentifier] NULL,
[OpposingDivisionDimensionValueBcId] [uniqueidentifier] NULL,
[ArDriverSalesDimensionValueBcId] [uniqueidentifier] NULL,
[RevenueDriverSalesDimensionValueBcId] [uniqueidentifier] NULL,
[BcTransactionUploadResultFid] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BcTransactionBatchItem] ADD CONSTRAINT [PK_BcTransactionBatchItem] PRIMARY KEY CLUSTERED ([BcTransactionBatchItemId]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_BcTransactionBatchItem_BcTransactionBatchFid] ON [dbo].[BcTransactionBatchItem] ([BcTransactionBatchFid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BcTransactionBatchItem] ADD CONSTRAINT [FK_BcTransactionBatchItem_AcctTransactionFid] FOREIGN KEY ([AcctTransactionFid]) REFERENCES [dbo].[AcctTransactions] ([ATPriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BcTransactionBatchItem] ADD CONSTRAINT [FK_BcTransactionBatchItem_BcTransactionatch] FOREIGN KEY ([BcTransactionBatchFid]) REFERENCES [dbo].[BcTransactionBatch] ([BcTransactionBatchId])
GO
ALTER TABLE [dbo].[BcTransactionBatchItem] ADD CONSTRAINT [FK_BcTransactionBatchItem_BcTransactionUploadResult] FOREIGN KEY ([BcTransactionUploadResultFid]) REFERENCES [dbo].[BcTransactionUploadResult] ([BcTransactionUploadResultId]) ON DELETE SET NULL
GO
GRANT SELECT ON [dbo].[BcTransactionBatchItem] TO [MssExec]
GRANT INSERT ON [dbo].[BcTransactionBatchItem] TO [MssExec]
GRANT DELETE ON [dbo].[BcTransactionBatchItem] TO [MssExec]
GRANT UPDATE ON [dbo].[BcTransactionBatchItem] TO [MssExec]
GO