
[dbo].[XLedgerXglToItemCodeMapping]
CREATE TABLE [dbo].[XLedgerXglToItemCodeMapping]
(
[XLedgerXglToItemCodeMappingId] [int] NOT NULL IDENTITY(1, 1),
[XglFid] [int] NOT NULL,
[ItemCodeFid] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XLedgerXglToItemCodeMapping] ADD CONSTRAINT [PK_XLedgerXglToItemCodeMapping] PRIMARY KEY NONCLUSTERED ([XLedgerXglToItemCodeMappingId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XLedgerXglToItemCodeMapping] ADD CONSTRAINT [IX_XLedgerXglToItemCodeMapping_Xgl_ItemCode] UNIQUE CLUSTERED ([XglFid], [ItemCodeFid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_XLedgerXglToItemCodeMapping_ItemCode] ON [dbo].[XLedgerXglToItemCodeMapping] ([ItemCodeFid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XLedgerXglToItemCodeMapping] ADD CONSTRAINT [FK_XLedgerXglToItemCodeMapping_ItemCode] FOREIGN KEY ([ItemCodeFid]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[XLedgerXglToItemCodeMapping] ADD CONSTRAINT [FK_XLedgerXglToItemCodeMapping_Xgl] FOREIGN KEY ([XglFid]) REFERENCES [dbo].[Xgl] ([XglId])
GO
GRANT SELECT ON [dbo].[XLedgerXglToItemCodeMapping] TO [MssExec]
GRANT INSERT ON [dbo].[XLedgerXglToItemCodeMapping] TO [MssExec]
GRANT DELETE ON [dbo].[XLedgerXglToItemCodeMapping] TO [MssExec]
GRANT UPDATE ON [dbo].[XLedgerXglToItemCodeMapping] TO [MssExec]
GO