Tables [dbo].[ARCustomers]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:55:42 AM Thursday, March 21, 2019
Last Modified1:16:23 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_ARCustomers: CustomerIDCustomerIDint4
False
1 - 1
BillToIDint4
True
Foreign Keys FK_ARCustomers_LocationID_ARCustomers: [dbo].[ARCustomers].LocationIDLocationIDint4
True
CustomerNumbervarchar(32)32
False
CustomerNamevarchar(128)128
False
Attnvarchar(64)64
False
Addressvarchar(64)64
False
Cityvarchar(32)32
False
Statevarchar(16)16
False
Zipvarchar(16)16
False
Countryvarchar(16)16
False
Longitudedecimal(18,15)9
True
Latitudedecimal(18,15)9
True
Phone1varchar(32)32
False
Phone2varchar(32)32
False
Faxvarchar(32)32
False
Emailvarchar(64)64
False
WebSitevarchar(64)64
False
Prospectbit1
False
Foreign Keys FK_ARCustomers_TermID_ShTerms: [dbo].[ShTerms].TermIDTermIDint4
True
Foreign Keys FK_ARCustomers_ShipMethodID_ShShipMethods: [dbo].[ShShipMethods].ShipMethodIDShipMethodIDint4
True
EINvarchar(32)32
False
Foreign Keys FK_ARCustomers_SalesRepID_ARSalesReps: [dbo].[ARSalesReps].SalesRepIDSalesRepIDint4
True
CreditLimitmoney8
False
Foreign Keys FK_ARCustomers_PriceLevelID_ARPriceLevels: [dbo].[ARPriceLevels].PriceLevelIDPriceLevelIDint4
False
DoFinChargesbit1
False
Foreign Keys FK_ARCustomers_AdjustmentID_SCAdjustment: [dbo].[SCAdjustment].AdjustmentIDAdjustmentIDint4
True
Foreign Keys FK_ARCustomers_TaxCodeID_ShTaxCodes: [dbo].[ShTaxCodes].TaxCodeIDTaxCodeIDint4
False
TaxNumbervarchar(32)32
False
Foreign Keys FK_ARCustomers_CustomerTypeID_ARCustomerTypes: [dbo].[ARCustomerTypes].CustomerTypeIDCustomerTypeIDint4
True
BlanketPOvarchar(32)32
False
Holdbit1
False
((0))
Remarksvarchar(1024)1024
False
Invoicesmoney8
False
((0))
Unappliedmoney8
False
((0))
Ordersmoney8
False
((0))
Activebit1
False
ShipTobit1
False
((0))
Foreign Keys FK_ARCustomers_BranchID_GLBranches: [dbo].[GLBranches].BranchIDBranchIDint4
False
Locksint4
False
((0))
CreatorIDchar(8)8
False
UpdatorIDchar(8)8
False
CreateDatedatetime8
False
(getdate())
LastUpdatedatetime8
False
(getdate())
timestamptimestamp8
True
Foreign Keys FK_ARCustomers_TechnicianID_SCTechnicians: [dbo].[SCTechnicians].TechnicianIDTechnicianIDint4
True
Foreign Keys FK_ARCustomers_TerritoryID_SCTerritories: [dbo].[SCTerritories].TerritoryIDTerritoryIDint4
True
CompanyCustomerbit1
False
((0))
AllowAutoOnHoldUpdatesbit1
False
((1))
Foreign Keys FK_ARCustomers_MailToID_ARCustomers: [dbo].[ARCustomers].MailToIDMailToIDint4
True
Foreign Keys FK_ARCustomers_ShTrackingConfigID_ShTrackingConfigs: [dbo].[ShTrackingConfigs].ShTrackingConfigIDShTrackingConfigIDint4
True
Foreign Keys FK_ARCustomers_CustomPriceLevelID_ARPriceLevels: [dbo].[ARPriceLevels].CustomPriceLevelIDCustomPriceLevelIDint4
True
EnableCustomPricingbit1
False
((0))
RequirePONumbit1
False
((0))
Foreign Keys FK_ARCustomers_EquipmentContactID_CMContacts: [dbo].[CMContacts].EquipmentContactIDEquipmentContactIDint4
True
Foreign Keys FK_ARCustomers_DecisionContactID_CMContacts: [dbo].[CMContacts].DecisionContactIDDecisionContactIDint4
True
AllowAutoMeterRequestsbit1
False
((0))
Foreign Keys FK_ARCustomers_ChargeMethodID_ARChargeMethods: [dbo].[ARChargeMethods].ChargeMethodIDChargeMethodIDint4
True
Foreign Keys FK_ARCustomers_DBFileHeaderID_DBFileHeader: [dbo].[DBFileHeader].DBFileHeaderIDDBFileHeaderIDint4
False
((1))
Countyvarchar(32)32
False
('')
Taxablebit1
False
((0))
HideBillToOrdersEinfobit1
False
((0))
Foreign Keys FK_ARCustomers_OnHoldCodeID_SHOnHoldCodes: [dbo].[ShOnHoldCodes].OnHoldCodeIDOnHoldCodeIDint4
True
Foreign Keys FK_ARCustomers_TimeZoneCodeID_SHTimeZoneCodes: [dbo].[SHTimeZoneCodes].TimeZoneCodeIDTimeZoneCodeIDint4
True
Foreign Keys FK_ARCustomers_OnSiteWarehouseID_ICWarehouses: [dbo].[ICWarehouses].OnSiteWarehouseIDOnSiteWarehouseIDint4
True
Foreign Keys FK_ARCustomers_ARContactID_CMContacts: [dbo].[CMContacts].ARContactIDARContactIDint4
True
ConsolidatedBillingEnabledbit1
False
((0))
ConsolidatedBillingMinBillingAmountmoney8
False
((0))
ConsolidatedBillingFlagint4
False
((0))
ConsolidatedBillingDefaultMinint4
False
((0))
ConsolidatedBillingCycleIDint4
True
ConsolidatedBillingNextBillingDatedatetime8
True
InheritParentCustomPricesbit1
False
((0))
SendStatementsbit1
False
((1))
UseBillToAddressbit1
False
((0))
BillToAttnvarchar(64)64
False
('')
BillToAddressvarchar(64)64
False
('')
BillToCityvarchar(32)32
False
('')
BillToCountyvarchar(32)32
False
('')
BillToStatevarchar(16)16
False
('')
BillToZipvarchar(16)16
False
('')
BillToCountryvarchar(16)16
False
('')
UseMapAddressbit1
False
((0))
MapAddressvarchar(64)64
False
('')
MapCityvarchar(32)32
False
('')
MapStatevarchar(16)16
False
('')
MapZipvarchar(16)16
False
('')
MapCountryvarchar(16)16
False
('')
Milesdecimal(16,4)9
False
((0))
Foreign Keys FK_ARCustomers_NoteID_ARCustomerNotes: [dbo].[ARCustomerNotes].NoteIDNoteIDint4
True
NoteFlagint4
False
((0))
WarnOnPODuplicatebit1
False
((0))
Foreign Keys FK_ARCustomers_MeterContactID_CMContacts: [dbo].[CMContacts].MeterContactIDMeterContactIDint4
True
ShowInAllBranchesbit1
False
((0))
Foreign Keys FK_ARCustomers_InvoiceMethod_SHDocSendMethods: [dbo].[SHDocSendMethods].InvoiceMethodInvoiceMethodtinyint1
False
((1))
Foreign Keys FK_ARCustomers_ARRepID_SHAgents: [dbo].[ShAgents].ARRepIDARRepIDint4
True
NoteCountint4
False
((0))
Foreign Keys FK_ARCustomers_EquipmentShipToContactID_CMContacts: [dbo].[CMContacts].EquipmentShipToContactIDEquipmentShipToContactIDint4
True
Foreign Keys FK_ARCustomers_TaxExemptCodeID_SHTaxExemptCodes: [dbo].[SHTaxExemptCodes].TaxExemptCodeIDTaxExemptCodeIDint4
True
Foreign Keys FK_ARCustomers_SLACodeID_SCSLACodes: [dbo].[SCSLACodes].SLACodeIDSLACodeIDint4
True
Foreign Keys FK_ARCustomers_WebCustomLinkID_WebCustomLinks: [dbo].[WebCustomLinks].WebCustomLinkIDWebCustomLinkIDint4
True
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK_ARCustomers: CustomerIDPK_ARCustomersCustomerID
True
80
NameNo CheckColumns
FK_ARCustomers_AdjustmentID_SCAdjustment
True
AdjustmentID->[dbo].[SCAdjustment].[AdjustmentID]
FK_ARCustomers_ARContactID_CMContactsARContactID->[dbo].[CMContacts].[ContactID]
FK_ARCustomers_ARRepID_SHAgentsARRepID->[dbo].[ShAgents].[AgentID]
FK_ARCustomers_BranchID_GLBranches
True
BranchID->[dbo].[GLBranches].[BranchID]
FK_ARCustomers_ChargeMethodID_ARChargeMethodsChargeMethodID->[dbo].[ARChargeMethods].[ChargeMethodID]
FK_ARCustomers_CustomerTypeID_ARCustomerTypes
True
CustomerTypeID->[dbo].[ARCustomerTypes].[CustomerTypeID]
FK_ARCustomers_CustomPriceLevelID_ARPriceLevels
True
CustomPriceLevelID->[dbo].[ARPriceLevels].[PriceLevelID]
FK_ARCustomers_DBFileHeaderID_DBFileHeaderDBFileHeaderID->[dbo].[DBFileHeader].[DBFileHeaderID]
FK_ARCustomers_DecisionContactID_CMContactsDecisionContactID->[dbo].[CMContacts].[ContactID]
FK_ARCustomers_EquipmentContactID_CMContactsEquipmentContactID->[dbo].[CMContacts].[ContactID]
FK_ARCustomers_EquipmentShipToContactID_CMContactsEquipmentShipToContactID->[dbo].[CMContacts].[ContactID]
FK_ARCustomers_InvoiceMethod_SHDocSendMethodsInvoiceMethod->[dbo].[SHDocSendMethods].[DocSendMethodID]
FK_ARCustomers_LocationID_ARCustomersLocationID->[dbo].[ARCustomers].[CustomerID]
FK_ARCustomers_MailToID_ARCustomers
True
MailToID->[dbo].[ARCustomers].[CustomerID]
FK_ARCustomers_MeterContactID_CMContactsMeterContactID->[dbo].[CMContacts].[ContactID]
FK_ARCustomers_NoteID_ARCustomerNotesNoteID->[dbo].[ARCustomerNotes].[NoteID]
FK_ARCustomers_OnHoldCodeID_SHOnHoldCodesOnHoldCodeID->[dbo].[ShOnHoldCodes].[OnHoldCodeID]
FK_ARCustomers_OnSiteWarehouseID_ICWarehousesOnSiteWarehouseID->[dbo].[ICWarehouses].[WarehouseID]
FK_ARCustomers_PriceLevelID_ARPriceLevels
True
PriceLevelID->[dbo].[ARPriceLevels].[PriceLevelID]
FK_ARCustomers_SalesRepID_ARSalesReps
True
SalesRepID->[dbo].[ARSalesReps].[SalesRepID]
FK_ARCustomers_ShipMethodID_ShShipMethods
True
ShipMethodID->[dbo].[ShShipMethods].[ShipMethodID]
FK_ARCustomers_ShTrackingConfigID_ShTrackingConfigs
True
ShTrackingConfigID->[dbo].[ShTrackingConfigs].[ShTrackingConfigID]
FK_ARCustomers_SLACodeID_SCSLACodesSLACodeID->[dbo].[SCSLACodes].[SLACodeID]
FK_ARCustomers_TaxCodeID_ShTaxCodes
True
TaxCodeID->[dbo].[ShTaxCodes].[TaxCodeID]
FK_ARCustomers_TaxExemptCodeID_SHTaxExemptCodesTaxExemptCodeID->[dbo].[SHTaxExemptCodes].[TaxExemptCodeID]
FK_ARCustomers_TechnicianID_SCTechnicians
True
TechnicianID->[dbo].[SCTechnicians].[TechnicianID]
FK_ARCustomers_TermID_ShTerms
True
TermID->[dbo].[ShTerms].[TermID]
FK_ARCustomers_TerritoryID_SCTerritories
True
TerritoryID->[dbo].[SCTerritories].[TerritoryID]
FK_ARCustomers_TimeZoneCodeID_SHTimeZoneCodesTimeZoneCodeID->[dbo].[SHTimeZoneCodes].[TimeZoneCodeID]
FK_ARCustomers_WebCustomLinkID_WebCustomLinksWebCustomLinkID->[dbo].[WebCustomLinks].[WebCustomLinkID]
CREATE TABLE [dbo].[ARCustomers]
(
[CustomerID] [int] NOT NULL IDENTITY(1, 1),
[BillToID] [int] NULL,
[LocationID] [int] NULL,
[CustomerNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CustomerName] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Attn] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Address] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[City] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[State] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Zip] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Country] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Longitude] [decimal] (18, 15) NULL,
[Latitude] [decimal] (18, 15) NULL,
[Phone1] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Phone2] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Fax] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Email] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[WebSite] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Prospect] [bit] NOT NULL,
[TermID] [int] NULL,
[ShipMethodID] [int] NULL,
[EIN] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SalesRepID] [int] NULL,
[CreditLimit] [money] NOT NULL,
[PriceLevelID] [int] NOT NULL,
[DoFinCharges] [bit] NOT NULL,
[AdjustmentID] [int] NULL,
[TaxCodeID] [int] NOT NULL,
[TaxNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CustomerTypeID] [int] NULL,
[BlanketPO] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Hold] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_Hold] DEFAULT ((0)),
[Remarks] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Invoices] [money] NOT NULL CONSTRAINT [DF_ARCustomers_Invoices] DEFAULT ((0)),
[Unapplied] [money] NOT NULL CONSTRAINT [DF_ARCustomers_Unapplied] DEFAULT ((0)),
[Orders] [money] NOT NULL CONSTRAINT [DF_ARCustomers_Orders] DEFAULT ((0)),
[Active] [bit] NOT NULL,
[ShipTo] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_ShipTo] DEFAULT ((0)),
[BranchID] [int] NOT NULL,
[Locks] [int] NOT NULL CONSTRAINT [DF_ARCustomers_Locks] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UpdatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_ARCustomers_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_ARCustomers_LastUpdate] DEFAULT (getdate()),
[timestamp] [timestamp] NULL,
[TechnicianID] [int] NULL,
[TerritoryID] [int] NULL,
[CompanyCustomer] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_CompanyCustomer] DEFAULT ((0)),
[AllowAutoOnHoldUpdates] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_AllowAutoOnHoldUpdates] DEFAULT ((1)),
[MailToID] [int] NULL,
[ShTrackingConfigID] [int] NULL,
[CustomPriceLevelID] [int] NULL,
[EnableCustomPricing] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_EnableCustomPricing] DEFAULT ((0)),
[RequirePONum] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_RequirePONum] DEFAULT ((0)),
[EquipmentContactID] [int] NULL,
[DecisionContactID] [int] NULL,
[AllowAutoMeterRequests] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_AllowAutoMeterRequests] DEFAULT ((0)),
[ChargeMethodID] [int] NULL,
[DBFileHeaderID] [int] NOT NULL CONSTRAINT [DF_ARCustomers_DBFileHeaderID] DEFAULT ((1)),
[County] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_County] DEFAULT (''),
[Taxable] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_Taxable] DEFAULT ((0)),
[HideBillToOrdersEinfo] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_HideBillToOrdersEinfo] DEFAULT ((0)),
[OnHoldCodeID] [int] NULL,
[TimeZoneCodeID] [int] NULL,
[OnSiteWarehouseID] [int] NULL,
[ARContactID] [int] NULL,
[ConsolidatedBillingEnabled] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_ConsolidatedBillingEnabled] DEFAULT ((0)),
[ConsolidatedBillingMinBillingAmount] [money] NOT NULL CONSTRAINT [DF_ARCustomers_ConsolidatedBillingMinBillingAmount] DEFAULT ((0)),
[ConsolidatedBillingFlag] [int] NOT NULL CONSTRAINT [DF_ARCustomers_ConsolidatedBillingFlag] DEFAULT ((0)),
[ConsolidatedBillingDefaultMin] [int] NOT NULL CONSTRAINT [DF_ARCustomers_ConsolidatedBillingDefaultMin] DEFAULT ((0)),
[ConsolidatedBillingCycleID] [int] NULL,
[ConsolidatedBillingNextBillingDate] [datetime] NULL,
[InheritParentCustomPrices] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_InheritParentCustomPrices] DEFAULT ((0)),
[SendStatements] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_SendStatements] DEFAULT ((1)),
[UseBillToAddress] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_UseBillToAddress] DEFAULT ((0)),
[BillToAttn] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToAttn] DEFAULT (''),
[BillToAddress] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToAddress] DEFAULT (''),
[BillToCity] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToCity] DEFAULT (''),
[BillToCounty] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToCounty] DEFAULT (''),
[BillToState] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToState] DEFAULT (''),
[BillToZip] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToZip] DEFAULT (''),
[BillToCountry] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_BillToCountry] DEFAULT (''),
[UseMapAddress] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_UseMapAddress] DEFAULT ((0)),
[MapAddress] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_MapAddress] DEFAULT (''),
[MapCity] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_MapCity] DEFAULT (''),
[MapState] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_MapState] DEFAULT (''),
[MapZip] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_MapZip] DEFAULT (''),
[MapCountry] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_ARCustomers_MapCountry] DEFAULT (''),
[Miles] [decimal] (16, 4) NOT NULL CONSTRAINT [DF_ARCustomers_Miles] DEFAULT ((0)),
[NoteID] [int] NULL,
[NoteFlag] [int] NOT NULL CONSTRAINT [DF_ARCustomers_NoteFlag] DEFAULT ((0)),
[WarnOnPODuplicate] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_WarnOnPODuplicate] DEFAULT ((0)),
[MeterContactID] [int] NULL,
[ShowInAllBranches] [bit] NOT NULL CONSTRAINT [DF_ARCustomers_ShowInAllBranches] DEFAULT ((0)),
[InvoiceMethod] [tinyint] NOT NULL CONSTRAINT [DF_ARCustomers_InvoiceMethod] DEFAULT ((1)),
[ARRepID] [int] NULL,
[NoteCount] [int] NOT NULL CONSTRAINT [DF_ARCustomers_NoteCount] DEFAULT ((0)),
[EquipmentShipToContactID] [int] NULL,
[TaxExemptCodeID] [int] NULL,
[SLACodeID] [int] NULL,
[WebCustomLinkID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [PK_ARCustomers] PRIMARY KEY CLUSTERED  ([CustomerID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_AdjustmentID_SCAdjustment] FOREIGN KEY ([AdjustmentID]) REFERENCES [dbo].[SCAdjustment] ([AdjustmentID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_ARContactID_CMContacts] FOREIGN KEY ([ARContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_ARRepID_SHAgents] FOREIGN KEY ([ARRepID]) REFERENCES [dbo].[ShAgents] ([AgentID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_BranchID_GLBranches] FOREIGN KEY ([BranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_ChargeMethodID_ARChargeMethods] FOREIGN KEY ([ChargeMethodID]) REFERENCES [dbo].[ARChargeMethods] ([ChargeMethodID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_CustomerTypeID_ARCustomerTypes] FOREIGN KEY ([CustomerTypeID]) REFERENCES [dbo].[ARCustomerTypes] ([CustomerTypeID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_CustomPriceLevelID_ARPriceLevels] FOREIGN KEY ([CustomPriceLevelID]) REFERENCES [dbo].[ARPriceLevels] ([PriceLevelID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_DBFileHeaderID_DBFileHeader] FOREIGN KEY ([DBFileHeaderID]) REFERENCES [dbo].[DBFileHeader] ([DBFileHeaderID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_DecisionContactID_CMContacts] FOREIGN KEY ([DecisionContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_EquipmentContactID_CMContacts] FOREIGN KEY ([EquipmentContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_EquipmentShipToContactID_CMContacts] FOREIGN KEY ([EquipmentShipToContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_InvoiceMethod_SHDocSendMethods] FOREIGN KEY ([InvoiceMethod]) REFERENCES [dbo].[SHDocSendMethods] ([DocSendMethodID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_LocationID_ARCustomers] FOREIGN KEY ([LocationID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_MailToID_ARCustomers] FOREIGN KEY ([MailToID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_MeterContactID_CMContacts] FOREIGN KEY ([MeterContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_NoteID_ARCustomerNotes] FOREIGN KEY ([NoteID]) REFERENCES [dbo].[ARCustomerNotes] ([NoteID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_OnHoldCodeID_SHOnHoldCodes] FOREIGN KEY ([OnHoldCodeID]) REFERENCES [dbo].[ShOnHoldCodes] ([OnHoldCodeID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_OnSiteWarehouseID_ICWarehouses] FOREIGN KEY ([OnSiteWarehouseID]) REFERENCES [dbo].[ICWarehouses] ([WarehouseID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_PriceLevelID_ARPriceLevels] FOREIGN KEY ([PriceLevelID]) REFERENCES [dbo].[ARPriceLevels] ([PriceLevelID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_SalesRepID_ARSalesReps] FOREIGN KEY ([SalesRepID]) REFERENCES [dbo].[ARSalesReps] ([SalesRepID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_ShipMethodID_ShShipMethods] FOREIGN KEY ([ShipMethodID]) REFERENCES [dbo].[ShShipMethods] ([ShipMethodID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_ShTrackingConfigID_ShTrackingConfigs] FOREIGN KEY ([ShTrackingConfigID]) REFERENCES [dbo].[ShTrackingConfigs] ([ShTrackingConfigID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_SLACodeID_SCSLACodes] FOREIGN KEY ([SLACodeID]) REFERENCES [dbo].[SCSLACodes] ([SLACodeID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_TaxCodeID_ShTaxCodes] FOREIGN KEY ([TaxCodeID]) REFERENCES [dbo].[ShTaxCodes] ([TaxCodeID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_TaxExemptCodeID_SHTaxExemptCodes] FOREIGN KEY ([TaxExemptCodeID]) REFERENCES [dbo].[SHTaxExemptCodes] ([TaxExemptCodeID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_TechnicianID_SCTechnicians] FOREIGN KEY ([TechnicianID]) REFERENCES [dbo].[SCTechnicians] ([TechnicianID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_TermID_ShTerms] FOREIGN KEY ([TermID]) REFERENCES [dbo].[ShTerms] ([TermID])
GO
ALTER TABLE [dbo].[ARCustomers] WITH NOCHECK ADD CONSTRAINT [FK_ARCustomers_TerritoryID_SCTerritories] FOREIGN KEY ([TerritoryID]) REFERENCES [dbo].[SCTerritories] ([TerritoryID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_TimeZoneCodeID_SHTimeZoneCodes] FOREIGN KEY ([TimeZoneCodeID]) REFERENCES [dbo].[SHTimeZoneCodes] ([TimeZoneCodeID])
GO
ALTER TABLE [dbo].[ARCustomers] ADD CONSTRAINT [FK_ARCustomers_WebCustomLinkID_WebCustomLinks] FOREIGN KEY ([WebCustomLinkID]) REFERENCES [dbo].[WebCustomLinks] ([WebCustomLinkID])
GO