Tables [dbo].[QuickBooksItemCodeMap]
Properties
PropertyValue
HeapYes
Row Count (~)0
Created3:49:52 PM Thursday, December 6, 2018
Last Modified3:49:52 PM Thursday, December 6, 2018
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_QuickBooksItemCodeMap: QuickBooksItemCodeMapIDQuickBooksItemCodeMapIDint4
No
1 - 1
Foreign Keys FK_QuickBooksItemCodeMap_ItemCode: [dbo].[ItemCode].ItemCodeFIDIndexes IX_QuickBooksItemCodeMap_ItemCode: ItemCodeFIDItemCodeFIDint4
No
Foreign Keys FK_QuickBooksItemCodeMap_RevenueItem: [dbo].[QuickBooksRevenueItem].RevenueItemFIDRevenueItemFIDint4
Yes
Foreign Keys FK_QuickBooksItemCodeMap_CommissionExpense: [dbo].[QuickBooksExpenseAccount].CommissionExpenseFIDCommissionExpenseFIDint4
Yes
Foreign Keys FK_QuickBooksItemCodeMap_ThirdPartyExpense: [dbo].[QuickBooksExpenseAccount].ThirdPartyExpenseFIDThirdPartyExpenseFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Primary Key PK_QuickBooksItemCodeMap: QuickBooksItemCodeMapIDPK_QuickBooksItemCodeMapQuickBooksItemCodeMapID
Yes
IX_QuickBooksItemCodeMap_ItemCodeItemCodeFID
Yes
Foreign Keys Foreign Keys
NameColumns
FK_QuickBooksItemCodeMap_CommissionExpenseCommissionExpenseFID->[dbo].[QuickBooksExpenseAccount].[QuickBooksExpenseAccountID]
FK_QuickBooksItemCodeMap_ItemCodeItemCodeFID->[dbo].[ItemCode].[ICPriKey]
FK_QuickBooksItemCodeMap_RevenueItemRevenueItemFID->[dbo].[QuickBooksRevenueItem].[QuickBooksRevenueItemID]
FK_QuickBooksItemCodeMap_ThirdPartyExpenseThirdPartyExpenseFID->[dbo].[QuickBooksExpenseAccount].[QuickBooksExpenseAccountID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[QuickBooksItemCodeMap]
(
[QuickBooksItemCodeMapID] [int] NOT NULL IDENTITY(1, 1),
[ItemCodeFID] [int] NOT NULL,
[RevenueItemFID] [int] NULL,
[CommissionExpenseFID] [int] NULL,
[ThirdPartyExpenseFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuickBooksItemCodeMap] ADD CONSTRAINT [PK_QuickBooksItemCodeMap] PRIMARY KEY NONCLUSTERED  ([QuickBooksItemCodeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuickBooksItemCodeMap] ADD CONSTRAINT [IX_QuickBooksItemCodeMap_ItemCode] UNIQUE NONCLUSTERED  ([ItemCodeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuickBooksItemCodeMap] ADD CONSTRAINT [FK_QuickBooksItemCodeMap_CommissionExpense] FOREIGN KEY ([CommissionExpenseFID]) REFERENCES [dbo].[QuickBooksExpenseAccount] ([QuickBooksExpenseAccountID])
GO
ALTER TABLE [dbo].[QuickBooksItemCodeMap] ADD CONSTRAINT [FK_QuickBooksItemCodeMap_ItemCode] FOREIGN KEY ([ItemCodeFID]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[QuickBooksItemCodeMap] ADD CONSTRAINT [FK_QuickBooksItemCodeMap_RevenueItem] FOREIGN KEY ([RevenueItemFID]) REFERENCES [dbo].[QuickBooksRevenueItem] ([QuickBooksRevenueItemID])
GO
ALTER TABLE [dbo].[QuickBooksItemCodeMap] ADD CONSTRAINT [FK_QuickBooksItemCodeMap_ThirdPartyExpense] FOREIGN KEY ([ThirdPartyExpenseFID]) REFERENCES [dbo].[QuickBooksExpenseAccount] ([QuickBooksExpenseAccountID])
GO
GRANT SELECT ON  [dbo].[QuickBooksItemCodeMap] TO [MssExec]
GRANT INSERT ON  [dbo].[QuickBooksItemCodeMap] TO [MssExec]
GRANT DELETE ON  [dbo].[QuickBooksItemCodeMap] TO [MssExec]
GRANT UPDATE ON  [dbo].[QuickBooksItemCodeMap] TO [MssExec]
GO
Uses