Tables [dbo].[SCEquipments]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:55:41 AM Thursday, March 21, 2019
Last Modified1:16:13 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_SCEquipments: EquipmentIDEquipmentIDint4
False
1 - 1
EquipmentNumbervarchar(32)32
False
Foreign Keys FK_SCEquipments_ItemID_ICItems1: [dbo].[ICItems1].ItemIDItemIDint4
False
SerialNumbervarchar(30)30
False
Foreign Keys FK_SCEquipments_CustomerID_ARCustomers: [dbo].[ARCustomers].CustomerIDCustomerIDint4
False
Foreign Keys FK_SCEquipments_BillToID_ARCustomers: [dbo].[ARCustomers].BillToIDBillToIDint4
False
Foreign Keys FK_SCEquipments_BillCodeID_SCBillCodes: [dbo].[SCBillCodes].BillCodeIDBillCodeIDint4
True
Foreign Keys FK_SCEquipments_LocationID_ARCustomers: [dbo].[ARCustomers].LocationIDLocationIDint4
True
Addressvarchar(64)64
False
Cityvarchar(32)32
False
Statevarchar(16)16
False
Zipvarchar(16)16
False
Countryvarchar(16)16
False
Locationvarchar(128)128
True
OfficeOpendatetime8
True
OfficeClosedatetime8
True
InstallDatedatetime8
True
Contactvarchar(50)50
False
ContactPhonevarchar(50)50
False
ContactFaxvarchar(50)50
False
DecisionMakervarchar(50)50
False
DecisionMakerPhonevarchar(50)50
False
DecisionMakerFaxvarchar(50)50
False
Foreign Keys FK_SCEquipments_TerritoryID_SCTerritories: [dbo].[SCTerritories].TerritoryIDTerritoryIDint4
False
Foreign Keys FK_SCEquipments_TechnicianID_SCTechnicians: [dbo].[SCTechnicians].TechnicianIDTechnicianIDint4
False
WarrantyDatedatetime8
True
WarrantyMeterint4
True
PMMeterIntervalint4
True
PMMeterDueint4
True
PMDateIntervalint4
True
PMDateDuedatetime8
True
PMUseMeterbit1
False
PMUseDatebit1
False
Remarksvarchar(1024)1024
False
Activebit1
False
Locksint4
False
((0))
CreatorIDchar(8)8
False
UpdatorIDchar(8)8
False
CreateDatedatetime8
False
(getdate())
LastUpdatedatetime8
False
(getdate())
timestamptimestamp8
True
Foreign Keys FK_SCEquipments_StatusID_ShEntryTypes: [dbo].[ShEntryTypes].StatusIDStatusIDint4
True
Foreign Keys FK_SCEquipments_ConditionID_SCEquipmentConditions: [dbo].[SCEquipmentConditions].ConditionIDConditionIDint4
True
Foreign Keys FK_SCEquipments_CurrentStatusHistoryID_SCEquipmentHistory: [dbo].[SCEquipmentHistory].CurrentStatusHistoryIDCurrentStatusHistoryIDint4
True
Foreign Keys FK_SCEquipments_SerialNumberID_ICSerialNumbers: [dbo].[ICSerialNumbers].SerialNumberIDSerialNumberIDint4
True
SerialNumberIDLockedbit1
False
((0))
UnReviewedbit1
False
((0))
Foreign Keys FK_SCEquipments_BranchID_GLBranches: [dbo].[GLBranches].BranchIDBranchIDint4
False
Foreign Keys FK_SCEquipments_ShTrackingConfigID_ShTrackingConfigs: [dbo].[ShTrackingConfigs].ShTrackingConfigIDShTrackingConfigIDint4
True
Foreign Keys FK_SCEquipments_ParentID_SCEquipments: [dbo].[SCEquipments].ParentIDParentIDint4
True
Hostingbit1
False
((0))
Attachedbit1
False
((0))
Foreign Keys FK_SCEquipments_BinID_ICBins: [dbo].[ICBins].BinIDBinIDint4
True
Foreign Keys FK_SCEquipments_LeaseID_SCContractLeases: [dbo].[SCContractLeases].LeaseIDLeaseIDint4
True
LeaseEquipmentNumbervarchar(32)32
True
Foreign Keys FK_SCEquipments_ModelID_ICModels: [dbo].[ICModels].ModelIDModelIDint4
False
IsMeteredbit1
False
((0))
RequireMeteronServiceCallsbit1
False
((0))
Foreign Keys FK_SCEquipments_MostRecentDefaultMeterReadingID_MTMeterReadings: [dbo].[MTMeterReadings].MostRecentDefaultMeterReadingIDMostRecentDefaultMeterReadingIDint4
True
MostRecentDefaultMeterReadingDisplaydecimal(18,6)9
True
MostRecentDefaultMeterReadingDatedatetime8
True
Foreign Keys FK_SCEquipments_DefaultMeterID_MTMeters: [dbo].[MTMeters].DefaultMeterIDDefaultMeterIDint4
True
EinfoEnabledbit1
False
((1))
Foreign Keys FK_SCEquipments_PriorityID_SCPriorities: [dbo].[SCPriorities].PriorityIDPriorityIDint4
True
PriorityWeightdecimal(14,4)9
False
((0))
UseModelCBCAParamsbit1
False
((1))
CBNoDaysint4
False
((0))
CANoDaysint4
False
((0))
CANoCallsint4
False
((0))
Foreign Keys FK_SCEquipments_EquipmentContactID_CMContacts: [dbo].[CMContacts].EquipmentContactIDEquipmentContactIDint4
True
Foreign Keys FK_SCEquipments_DecisionContactID_CMContacts: [dbo].[CMContacts].DecisionContactIDDecisionContactIDint4
True
AllowAutoMeterRequestsbit1
False
((0))
UseContractOverageCyclebit1
False
((1))
NextMeterReadingdatetime8
True
Foreign Keys FK_SCEquipments_MeterReadingCycleID_SCBillingCycles: [dbo].[SCBillingCycles].MeterReadingCycleIDMeterReadingCycleIDint4
True
Foreign Keys FK_SCEquipments_DBFileHeaderID_DBFileHeader: [dbo].[DBFileHeader].DBFileHeaderIDDBFileHeaderIDint4
False
((1))
LastMeterRequestdatetime8
True
Foreign Keys FK_SCEquipments_TimeZoneCodeID_ShTimeZoneCodes: [dbo].[SHTimeZoneCodes].TimeZoneCodeIDTimeZoneCodeIDint4
True
ExpireByUsagebit1
False
((0))
WarrantyEndMeterdecimal(18,6)9
True
ExpireWarrantyIsDefaultbit1
False
((0))
TransactionWarrantyGroupIDint4
True
Foreign Keys FK_SCEquipments_OnSiteWarehouseID_ICWarehouses: [dbo].[ICWarehouses].OnSiteWarehouseIDOnSiteWarehouseIDint4
True
Foreign Keys FK_SCEquipments_NoteID_SCEquipmentNotes: [dbo].[SCEquipmentNotes].NoteIDNoteIDint4
True
NoteFlagint4
False
((0))
Foreign Keys FK_SCEquipments_MeterContactID_CMContacts: [dbo].[CMContacts].MeterContactIDMeterContactIDint4
True
Foreign Keys FK_SCEquipments_AssetID_GLAssets: [dbo].[GLAssets].AssetIDAssetIDint4
True
IPAddressvarchar(50)50
False
('')
MACAddressvarchar(32)32
False
('')
NoteCountint4
False
((0))
Foreign Keys FK_SCEquipments_ShipToContactID_CMContacts: [dbo].[CMContacts].ShipToContactIDShipToContactIDint4
True
CBNoClicksdecimal(18,6)9
False
((0))
CANoClicksdecimal(18,6)9
False
((0))
Foreign Keys FK_SCEquipments_SLACodeID_SCSLACodes: [dbo].[SCSLACodes].SLACodeIDSLACodeIDint4
True
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK_SCEquipments: EquipmentIDPK_SCEquipmentsEquipmentID
True
80
NameNo CheckColumns
FK_SCEquipments_AssetID_GLAssetsAssetID->[dbo].[GLAssets].[AssetID]
FK_SCEquipments_BillCodeID_SCBillCodesBillCodeID->[dbo].[SCBillCodes].[BillCodeID]
FK_SCEquipments_BillToID_ARCustomers
True
BillToID->[dbo].[ARCustomers].[CustomerID]
FK_SCEquipments_BinID_ICBinsBinID->[dbo].[ICBins].[BinID]
FK_SCEquipments_BranchID_GLBranchesBranchID->[dbo].[GLBranches].[BranchID]
FK_SCEquipments_ConditionID_SCEquipmentConditionsConditionID->[dbo].[SCEquipmentConditions].[SCEquipmentConditionID]
FK_SCEquipments_CurrentStatusHistoryID_SCEquipmentHistoryCurrentStatusHistoryID->[dbo].[SCEquipmentHistory].[SCEquipmentHistoryID]
FK_SCEquipments_CustomerID_ARCustomers
True
CustomerID->[dbo].[ARCustomers].[CustomerID]
FK_SCEquipments_DBFileHeaderID_DBFileHeaderDBFileHeaderID->[dbo].[DBFileHeader].[DBFileHeaderID]
FK_SCEquipments_DecisionContactID_CMContactsDecisionContactID->[dbo].[CMContacts].[ContactID]
FK_SCEquipments_DefaultMeterID_MTMetersDefaultMeterID->[dbo].[MTMeters].[MeterID]
FK_SCEquipments_EquipmentContactID_CMContactsEquipmentContactID->[dbo].[CMContacts].[ContactID]
FK_SCEquipments_ItemID_ICItems1ItemID->[dbo].[ICItems1].[ItemID]
FK_SCEquipments_LeaseID_SCContractLeasesLeaseID->[dbo].[SCContractLeases].[ContractLeaseID]
FK_SCEquipments_LocationID_ARCustomers
True
LocationID->[dbo].[ARCustomers].[CustomerID]
FK_SCEquipments_MeterContactID_CMContactsMeterContactID->[dbo].[CMContacts].[ContactID]
FK_SCEquipments_MeterReadingCycleID_SCBillingCyclesMeterReadingCycleID->[dbo].[SCBillingCycles].[BillingCycleID]
FK_SCEquipments_ModelID_ICModelsModelID->[dbo].[ICModels].[ModelID]
FK_SCEquipments_MostRecentDefaultMeterReadingID_MTMeterReadingsMostRecentDefaultMeterReadingID->[dbo].[MTMeterReadings].[MeterReadingID]
FK_SCEquipments_NoteID_SCEquipmentNotesNoteID->[dbo].[SCEquipmentNotes].[NoteID]
FK_SCEquipments_OnSiteWarehouseID_ICWarehousesOnSiteWarehouseID->[dbo].[ICWarehouses].[WarehouseID]
FK_SCEquipments_ParentID_SCEquipmentsParentID->[dbo].[SCEquipments].[EquipmentID]
FK_SCEquipments_PriorityID_SCPrioritiesPriorityID->[dbo].[SCPriorities].[PriorityID]
FK_SCEquipments_SerialNumberID_ICSerialNumbersSerialNumberID->[dbo].[ICSerialNumbers].[LookUpID]
FK_SCEquipments_ShipToContactID_CMContactsShipToContactID->[dbo].[CMContacts].[ContactID]
FK_SCEquipments_ShTrackingConfigID_ShTrackingConfigsShTrackingConfigID->[dbo].[ShTrackingConfigs].[ShTrackingConfigID]
FK_SCEquipments_SLACodeID_SCSLACodesSLACodeID->[dbo].[SCSLACodes].[SLACodeID]
FK_SCEquipments_StatusID_ShEntryTypesStatusID->[dbo].[ShEntryTypes].[ShEntryTypeID]
FK_SCEquipments_TechnicianID_SCTechniciansTechnicianID->[dbo].[SCTechnicians].[TechnicianID]
FK_SCEquipments_TerritoryID_SCTerritoriesTerritoryID->[dbo].[SCTerritories].[TerritoryID]
FK_SCEquipments_TimeZoneCodeID_ShTimeZoneCodesTimeZoneCodeID->[dbo].[SHTimeZoneCodes].[TimeZoneCodeID]
CREATE TABLE [dbo].[SCEquipments]
(
[EquipmentID] [int] NOT NULL IDENTITY(1, 1),
[EquipmentNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ItemID] [int] NOT NULL,
[SerialNumber] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CustomerID] [int] NOT NULL,
[BillToID] [int] NOT NULL,
[BillCodeID] [int] NULL,
[LocationID] [int] 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,
[Location] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OfficeOpen] [datetime] NULL,
[OfficeClose] [datetime] NULL,
[InstallDate] [datetime] NULL,
[Contact] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ContactPhone] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ContactFax] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DecisionMaker] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DecisionMakerPhone] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DecisionMakerFax] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TerritoryID] [int] NOT NULL,
[TechnicianID] [int] NOT NULL,
[WarrantyDate] [datetime] NULL,
[WarrantyMeter] [int] NULL,
[PMMeterInterval] [int] NULL,
[PMMeterDue] [int] NULL,
[PMDateInterval] [int] NULL,
[PMDateDue] [datetime] NULL,
[PMUseMeter] [bit] NOT NULL,
[PMUseDate] [bit] NOT NULL,
[Remarks] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Active] [bit] NOT NULL,
[Locks] [int] NOT NULL CONSTRAINT [DF_SCEquipments_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_SCEquipments_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_SCEquipments_LastUpdate] DEFAULT (getdate()),
[timestamp] [timestamp] NULL,
[StatusID] [int] NULL,
[ConditionID] [int] NULL,
[CurrentStatusHistoryID] [int] NULL,
[SerialNumberID] [int] NULL,
[SerialNumberIDLocked] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_SerialNumberIDLocked] DEFAULT ((0)),
[UnReviewed] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_UnReviewed] DEFAULT ((0)),
[BranchID] [int] NOT NULL,
[ShTrackingConfigID] [int] NULL,
[ParentID] [int] NULL,
[Hosting] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_Hosting] DEFAULT ((0)),
[Attached] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_Attached] DEFAULT ((0)),
[BinID] [int] NULL,
[LeaseID] [int] NULL,
[LeaseEquipmentNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ModelID] [int] NOT NULL,
[IsMetered] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_IsMetered] DEFAULT ((0)),
[RequireMeteronServiceCalls] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_RequireMeteronServiceCalls] DEFAULT ((0)),
[MostRecentDefaultMeterReadingID] [int] NULL,
[MostRecentDefaultMeterReadingDisplay] [decimal] (18, 6) NULL,
[MostRecentDefaultMeterReadingDate] [datetime] NULL,
[DefaultMeterID] [int] NULL,
[EinfoEnabled] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_EinfoEnabled] DEFAULT ((1)),
[PriorityID] [int] NULL,
[PriorityWeight] [decimal] (14, 4) NOT NULL CONSTRAINT [DF_SCEquipments_PriorityWeight] DEFAULT ((0)),
[UseModelCBCAParams] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_UseModelCBCAParams] DEFAULT ((1)),
[CBNoDays] [int] NOT NULL CONSTRAINT [DF_SCEquipments_CBNoDays] DEFAULT ((0)),
[CANoDays] [int] NOT NULL CONSTRAINT [DF_SCEquipments_CANoDays] DEFAULT ((0)),
[CANoCalls] [int] NOT NULL CONSTRAINT [DF_SCEquipments_CANoCalls] DEFAULT ((0)),
[EquipmentContactID] [int] NULL,
[DecisionContactID] [int] NULL,
[AllowAutoMeterRequests] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_AllowAutoMeterRequests] DEFAULT ((0)),
[UseContractOverageCycle] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_UseContractOverageCycle] DEFAULT ((1)),
[NextMeterReading] [datetime] NULL,
[MeterReadingCycleID] [int] NULL,
[DBFileHeaderID] [int] NOT NULL CONSTRAINT [DF_SCEquipments_DBFileHeaderID] DEFAULT ((1)),
[LastMeterRequest] [datetime] NULL,
[TimeZoneCodeID] [int] NULL,
[ExpireByUsage] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_ExpireByUsage] DEFAULT ((0)),
[WarrantyEndMeter] [decimal] (18, 6) NULL,
[ExpireWarrantyIsDefault] [bit] NOT NULL CONSTRAINT [DF_SCEquipments_ExpireWarrantyIsDefault] DEFAULT ((0)),
[TransactionWarrantyGroupID] [int] NULL,
[OnSiteWarehouseID] [int] NULL,
[NoteID] [int] NULL,
[NoteFlag] [int] NOT NULL CONSTRAINT [DF_SCEquipments_NoteFlag] DEFAULT ((0)),
[MeterContactID] [int] NULL,
[AssetID] [int] NULL,
[IPAddress] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_SCEquipments_IPAddress] DEFAULT (''),
[MACAddress] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_SCEquipments_MACAddress] DEFAULT (''),
[NoteCount] [int] NOT NULL CONSTRAINT [DF_SCEquipments_NoteCount] DEFAULT ((0)),
[ShipToContactID] [int] NULL,
[CBNoClicks] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_SCEquipments_CBNoClicks] DEFAULT ((0)),
[CANoClicks] [decimal] (18, 6) NOT NULL CONSTRAINT [DF_SCEquipments_CANoClicks] DEFAULT ((0)),
[SLACodeID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [PK_SCEquipments] PRIMARY KEY CLUSTERED  ([EquipmentID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_AssetID_GLAssets] FOREIGN KEY ([AssetID]) REFERENCES [dbo].[GLAssets] ([AssetID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_BillCodeID_SCBillCodes] FOREIGN KEY ([BillCodeID]) REFERENCES [dbo].[SCBillCodes] ([BillCodeID])
GO
ALTER TABLE [dbo].[SCEquipments] WITH NOCHECK ADD CONSTRAINT [FK_SCEquipments_BillToID_ARCustomers] FOREIGN KEY ([BillToID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_BinID_ICBins] FOREIGN KEY ([BinID]) REFERENCES [dbo].[ICBins] ([BinID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_BranchID_GLBranches] FOREIGN KEY ([BranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_ConditionID_SCEquipmentConditions] FOREIGN KEY ([ConditionID]) REFERENCES [dbo].[SCEquipmentConditions] ([SCEquipmentConditionID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_CurrentStatusHistoryID_SCEquipmentHistory] FOREIGN KEY ([CurrentStatusHistoryID]) REFERENCES [dbo].[SCEquipmentHistory] ([SCEquipmentHistoryID])
GO
ALTER TABLE [dbo].[SCEquipments] WITH NOCHECK ADD CONSTRAINT [FK_SCEquipments_CustomerID_ARCustomers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_DBFileHeaderID_DBFileHeader] FOREIGN KEY ([DBFileHeaderID]) REFERENCES [dbo].[DBFileHeader] ([DBFileHeaderID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_DecisionContactID_CMContacts] FOREIGN KEY ([DecisionContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_DefaultMeterID_MTMeters] FOREIGN KEY ([DefaultMeterID]) REFERENCES [dbo].[MTMeters] ([MeterID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_EquipmentContactID_CMContacts] FOREIGN KEY ([EquipmentContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_ItemID_ICItems1] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[ICItems1] ([ItemID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_LeaseID_SCContractLeases] FOREIGN KEY ([LeaseID]) REFERENCES [dbo].[SCContractLeases] ([ContractLeaseID])
GO
ALTER TABLE [dbo].[SCEquipments] WITH NOCHECK ADD CONSTRAINT [FK_SCEquipments_LocationID_ARCustomers] FOREIGN KEY ([LocationID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_MeterContactID_CMContacts] FOREIGN KEY ([MeterContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_MeterReadingCycleID_SCBillingCycles] FOREIGN KEY ([MeterReadingCycleID]) REFERENCES [dbo].[SCBillingCycles] ([BillingCycleID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_ModelID_ICModels] FOREIGN KEY ([ModelID]) REFERENCES [dbo].[ICModels] ([ModelID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_MostRecentDefaultMeterReadingID_MTMeterReadings] FOREIGN KEY ([MostRecentDefaultMeterReadingID]) REFERENCES [dbo].[MTMeterReadings] ([MeterReadingID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_NoteID_SCEquipmentNotes] FOREIGN KEY ([NoteID]) REFERENCES [dbo].[SCEquipmentNotes] ([NoteID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_OnSiteWarehouseID_ICWarehouses] FOREIGN KEY ([OnSiteWarehouseID]) REFERENCES [dbo].[ICWarehouses] ([WarehouseID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_ParentID_SCEquipments] FOREIGN KEY ([ParentID]) REFERENCES [dbo].[SCEquipments] ([EquipmentID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_PriorityID_SCPriorities] FOREIGN KEY ([PriorityID]) REFERENCES [dbo].[SCPriorities] ([PriorityID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_SerialNumberID_ICSerialNumbers] FOREIGN KEY ([SerialNumberID]) REFERENCES [dbo].[ICSerialNumbers] ([LookUpID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_ShipToContactID_CMContacts] FOREIGN KEY ([ShipToContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_ShTrackingConfigID_ShTrackingConfigs] FOREIGN KEY ([ShTrackingConfigID]) REFERENCES [dbo].[ShTrackingConfigs] ([ShTrackingConfigID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_SLACodeID_SCSLACodes] FOREIGN KEY ([SLACodeID]) REFERENCES [dbo].[SCSLACodes] ([SLACodeID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_StatusID_ShEntryTypes] FOREIGN KEY ([StatusID]) REFERENCES [dbo].[ShEntryTypes] ([ShEntryTypeID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_TechnicianID_SCTechnicians] FOREIGN KEY ([TechnicianID]) REFERENCES [dbo].[SCTechnicians] ([TechnicianID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_TerritoryID_SCTerritories] FOREIGN KEY ([TerritoryID]) REFERENCES [dbo].[SCTerritories] ([TerritoryID])
GO
ALTER TABLE [dbo].[SCEquipments] ADD CONSTRAINT [FK_SCEquipments_TimeZoneCodeID_ShTimeZoneCodes] FOREIGN KEY ([TimeZoneCodeID]) REFERENCES [dbo].[SHTimeZoneCodes] ([TimeZoneCodeID])
GO