Tables [dbo].[ICSalesServiceLedger]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:55:54 AM Thursday, March 21, 2019
Last Modified1:12:00 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK__ICSalesS__AE70E0AFCFEECB4F: LedgerIDLedgerIDint4
False
1 - 1
Datedatetime8
False
Periodint4
False
TransactionIDint4
False
Foreign Keys FK_ICSalesServiceLedger_TransactionTypeID_ShTransactionTypes: [dbo].[ShTransactionTypes].TransactionTypeIDTransactionTypeIDint4
False
TransactionNumbervarchar(300)300
False
Foreign Keys FK_ICSalesServiceLedger_CustomerID_ARCustomers: [dbo].[ARCustomers].CustomerIDCustomerIDint4
True
Foreign Keys FK_ICSalesServiceLedger_BillToID_ARCustomers: [dbo].[ARCustomers].BillToIDBillToIDint4
True
Foreign Keys FK_ICSalesServiceLedger_ShipToID_ARCustomers: [dbo].[ARCustomers].ShipToIDShipToIDint4
True
Foreign Keys FK_ICSalesServiceLedger_InvoiceID_ARInvoices: [dbo].[ARInvoices].InvoiceIDInvoiceIDint4
True
Foreign Keys FK_ICSalesServiceLedger_InvoiceTransactionTypeID_ShTransactionTypes: [dbo].[ShTransactionTypes].InvoiceTransactionTypeIDInvoiceTransactionTypeIDint4
True
InvoiceNumbervarchar(32)32
True
Foreign Keys FK_ICSalesServiceLedger_SOID_SOOrders: [dbo].[SOOrders].SOIDSOIDint4
True
SONumbervarchar(32)32
True
InvoiceDescriptionvarchar(255)255
True
Descriptionvarchar(255)255
True
Foreign Keys FK_ICSalesServiceLedger_SalesRepID_ARSalesReps: [dbo].[ARSalesReps].SalesRepIDSalesRepIDint4
True
Foreign Keys FK_ICSalesServiceLedger_TechnicianID_SCTechnicians: [dbo].[SCTechnicians].TechnicianIDTechnicianIDint4
True
Foreign Keys FK_ICSalesServiceLedger_CallID_SCCalls: [dbo].[SCCalls].CallIDCallIDint4
True
Foreign Keys FK_ICSalesServiceLedger_ReportBillGroupID_SCReportBillGroups: [dbo].[SCReportBillGroups].ReportBillGroupIDReportBillGroupIDint4
True
Foreign Keys FK_ICSalesServiceLedger_BranchID_GLBranches: [dbo].[GLBranches].BranchIDBranchIDint4
False
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK__ICSalesS__AE70E0AFCFEECB4F: LedgerIDPK__ICSalesS__AE70E0AFCFEECB4FLedgerID
True
80
NameNo CheckColumns
FK_ICSalesServiceLedger_BillToID_ARCustomers
True
BillToID->[dbo].[ARCustomers].[CustomerID]
FK_ICSalesServiceLedger_BranchID_GLBranchesBranchID->[dbo].[GLBranches].[BranchID]
FK_ICSalesServiceLedger_CallID_SCCallsCallID->[dbo].[SCCalls].[CallID]
FK_ICSalesServiceLedger_CustomerID_ARCustomers
True
CustomerID->[dbo].[ARCustomers].[CustomerID]
FK_ICSalesServiceLedger_InvoiceID_ARInvoices
True
InvoiceID->[dbo].[ARInvoices].[InvoiceID]
FK_ICSalesServiceLedger_InvoiceTransactionTypeID_ShTransactionTypesInvoiceTransactionTypeID->[dbo].[ShTransactionTypes].[TransactionTypeID]
FK_ICSalesServiceLedger_ReportBillGroupID_SCReportBillGroupsReportBillGroupID->[dbo].[SCReportBillGroups].[ReportBillGroupID]
FK_ICSalesServiceLedger_SalesRepID_ARSalesRepsSalesRepID->[dbo].[ARSalesReps].[SalesRepID]
FK_ICSalesServiceLedger_ShipToID_ARCustomers
True
ShipToID->[dbo].[ARCustomers].[CustomerID]
FK_ICSalesServiceLedger_SOID_SOOrdersSOID->[dbo].[SOOrders].[SOID]
FK_ICSalesServiceLedger_TechnicianID_SCTechniciansTechnicianID->[dbo].[SCTechnicians].[TechnicianID]
FK_ICSalesServiceLedger_TransactionTypeID_ShTransactionTypesTransactionTypeID->[dbo].[ShTransactionTypes].[TransactionTypeID]
CREATE TABLE [dbo].[ICSalesServiceLedger]
(
[LedgerID] [int] NOT NULL IDENTITY(1, 1),
[Date] [datetime] NOT NULL,
[Period] [int] NOT NULL,
[TransactionID] [int] NOT NULL,
[TransactionTypeID] [int] NOT NULL,
[TransactionNumber] [varchar] (300) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CustomerID] [int] NULL,
[BillToID] [int] NULL,
[ShipToID] [int] NULL,
[InvoiceID] [int] NULL,
[InvoiceTransactionTypeID] [int] NULL,
[InvoiceNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SOID] [int] NULL,
[SONumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InvoiceDescription] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SalesRepID] [int] NULL,
[TechnicianID] [int] NULL,
[CallID] [int] NULL,
[ReportBillGroupID] [int] NULL,
[BranchID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [PK__ICSalesS__AE70E0AFCFEECB4F] PRIMARY KEY CLUSTERED  ([LedgerID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] WITH NOCHECK ADD CONSTRAINT [FK_ICSalesServiceLedger_BillToID_ARCustomers] FOREIGN KEY ([BillToID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_BranchID_GLBranches] FOREIGN KEY ([BranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_CallID_SCCalls] FOREIGN KEY ([CallID]) REFERENCES [dbo].[SCCalls] ([CallID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] WITH NOCHECK ADD CONSTRAINT [FK_ICSalesServiceLedger_CustomerID_ARCustomers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] WITH NOCHECK ADD CONSTRAINT [FK_ICSalesServiceLedger_InvoiceID_ARInvoices] FOREIGN KEY ([InvoiceID]) REFERENCES [dbo].[ARInvoices] ([InvoiceID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_InvoiceTransactionTypeID_ShTransactionTypes] FOREIGN KEY ([InvoiceTransactionTypeID]) REFERENCES [dbo].[ShTransactionTypes] ([TransactionTypeID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_ReportBillGroupID_SCReportBillGroups] FOREIGN KEY ([ReportBillGroupID]) REFERENCES [dbo].[SCReportBillGroups] ([ReportBillGroupID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_SalesRepID_ARSalesReps] FOREIGN KEY ([SalesRepID]) REFERENCES [dbo].[ARSalesReps] ([SalesRepID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] WITH NOCHECK ADD CONSTRAINT [FK_ICSalesServiceLedger_ShipToID_ARCustomers] FOREIGN KEY ([ShipToID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_SOID_SOOrders] FOREIGN KEY ([SOID]) REFERENCES [dbo].[SOOrders] ([SOID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_TechnicianID_SCTechnicians] FOREIGN KEY ([TechnicianID]) REFERENCES [dbo].[SCTechnicians] ([TechnicianID])
GO
ALTER TABLE [dbo].[ICSalesServiceLedger] ADD CONSTRAINT [FK_ICSalesServiceLedger_TransactionTypeID_ShTransactionTypes] FOREIGN KEY ([TransactionTypeID]) REFERENCES [dbo].[ShTransactionTypes] ([TransactionTypeID])
GO