Tables [dbo].[SCEquipmentProfileHistory]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:56:20 AM Thursday, March 21, 2019
Last Modified1:15:05 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_SCEquipmentProfileHistory: EquipmentProfileHistoryIDEquipmentProfileHistoryIDint4
False
1 - 1
Foreign Keys FK_SCEquipmentProfileHistory_EquipmentHistoryID_SCEquipmentHistory: [dbo].[SCEquipmentHistory].EquipmentHistoryIDEquipmentHistoryIDint4
False
EquipmentIDint4
False
EquipmentNumbervarchar(32)32
False
Foreign Keys FK_SCEquipmentProfileHistory_ItemID_ICItems1: [dbo].[ICItems1].ItemIDItemIDint4
False
SerialNumbervarchar(30)30
False
Foreign Keys FK_SCEquipmentProfileHistory_SerialNumberID_ICSerialNumbers: [dbo].[ICSerialNumbers].SerialNumberIDSerialNumberIDint4
True
SerialNumberIDLockedbit1
False
((0))
Foreign Keys FK_SCEquipmentProfileHistory_CustomerID_ARCustomers: [dbo].[ARCustomers].CustomerIDCustomerIDint4
False
Foreign Keys FK_SCEquipmentProfileHistory_BillToID_ARCustomers: [dbo].[ARCustomers].BillToIDBillToIDint4
False
Foreign Keys FK_SCEquipmentProfileHistory_BillCodeID_SCBillCodes: [dbo].[SCBillCodes].BillCodeIDBillCodeIDint4
True
ResponseTimeint4
False
Foreign Keys FK_SCEquipmentProfileHistory_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_SCEquipmentProfileHistory_TerritoryID_SCTerritories: [dbo].[SCTerritories].TerritoryIDTerritoryIDint4
False
Foreign Keys FK_SCEquipmentProfileHistory_TechnicianID_SCTechnicians: [dbo].[SCTechnicians].TechnicianIDTechnicianIDint4
False
WarrantyDatedatetime8
True
WarrantyMeterint4
True
PMMeterIntervalint4
True
PMMeterDueint4
True
PMDateIntervalint4
True
PMDateDuedatetime8
True
PMUseMeterbit1
False
PMUseDatebit1
False
Foreign Keys FK_SCEquipmentProfileHistory_StatusID_ShEntryTypes: [dbo].[ShEntryTypes].StatusIDStatusIDint4
True
Foreign Keys FK_SCEquipmentProfileHistory_ConditionID_SCEquipmentConditions: [dbo].[SCEquipmentConditions].ConditionIDConditionIDint4
True
Foreign Keys FK_SCEquipmentProfileHistory_CurrentStatusHistoryID_SCEquipmentHistory: [dbo].[SCEquipmentHistory].CurrentStatusHistoryIDCurrentStatusHistoryIDint4
True
UnReviewedbit1
False
((0))
Foreign Keys FK_SCEquipmentProfileHistory_BranchID_GLBranches: [dbo].[GLBranches].BranchIDBranchIDint4
False
Remarksvarchar(1024)1024
False
Activebit1
False
ParentIDint4
True
Hostingbit1
False
((0))
Attachedbit1
False
((0))
Foreign Keys FK_SCEquipmentProfileHistory_BinID_ICBins: [dbo].[ICBins].BinIDBinIDint4
True
FillerRecordOnlybit1
False
((0))
ModelIDint4
False
IsMeteredbit1
False
Foreign Keys FK_SCEquipmentProfileHistory_DefaultMeterID_MTMeters: [dbo].[MTMeters].DefaultMeterIDDefaultMeterIDint4
True
RequireMeteronServiceCallsbit1
False
Foreign Keys FK_SCEquipmentProfileHistory_ShTrackingConfigID_ShTrackingConfigs: [dbo].[ShTrackingConfigs].ShTrackingConfigIDShTrackingConfigIDint4
True
Foreign Keys FK_SCEquipmentProfileHistory_MostRecentDefaultMeterReadingID_MTMeterReadings: [dbo].[MTMeterReadings].MostRecentDefaultMeterReadingIDMostRecentDefaultMeterReadingIDint4
True
MostRecentDefaultMeterReadingDisplaydecimal(18,6)9
True
MostRecentDefaultMeterReadingDatedatetime8
True
Foreign Keys FK_SCEquipmentProfileHistory_MostRecentHostDefaultMeterReadingID_MTMeterReadings: [dbo].[MTMeterReadings].MostRecentHostDefaultMeterReadingIDMostRecentHostDefaultMeterReadingIDint4
True
MostRecentHostDefaultMeterReadingDisplaydecimal(18,6)9
True
MostRecentHostDefaultMeterReadingDatedatetime8
True
CreateDatedatetime8
False
(getdate())
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK_SCEquipmentProfileHistory: EquipmentProfileHistoryIDPK_SCEquipmentProfileHistoryEquipmentProfileHistoryID
True
80
NameNo CheckColumns
FK_SCEquipmentProfileHistory_BillCodeID_SCBillCodesBillCodeID->[dbo].[SCBillCodes].[BillCodeID]
FK_SCEquipmentProfileHistory_BillToID_ARCustomers
True
BillToID->[dbo].[ARCustomers].[CustomerID]
FK_SCEquipmentProfileHistory_BinID_ICBinsBinID->[dbo].[ICBins].[BinID]
FK_SCEquipmentProfileHistory_BranchID_GLBranchesBranchID->[dbo].[GLBranches].[BranchID]
FK_SCEquipmentProfileHistory_ConditionID_SCEquipmentConditionsConditionID->[dbo].[SCEquipmentConditions].[SCEquipmentConditionID]
FK_SCEquipmentProfileHistory_CurrentStatusHistoryID_SCEquipmentHistoryCurrentStatusHistoryID->[dbo].[SCEquipmentHistory].[SCEquipmentHistoryID]
FK_SCEquipmentProfileHistory_CustomerID_ARCustomers
True
CustomerID->[dbo].[ARCustomers].[CustomerID]
FK_SCEquipmentProfileHistory_DefaultMeterID_MTMetersDefaultMeterID->[dbo].[MTMeters].[MeterID]
FK_SCEquipmentProfileHistory_EquipmentHistoryID_SCEquipmentHistoryEquipmentHistoryID->[dbo].[SCEquipmentHistory].[SCEquipmentHistoryID]
FK_SCEquipmentProfileHistory_ItemID_ICItems1ItemID->[dbo].[ICItems1].[ItemID]
FK_SCEquipmentProfileHistory_LocationID_ARCustomers
True
LocationID->[dbo].[ARCustomers].[CustomerID]
FK_SCEquipmentProfileHistory_MostRecentDefaultMeterReadingID_MTMeterReadingsMostRecentDefaultMeterReadingID->[dbo].[MTMeterReadings].[MeterReadingID]
FK_SCEquipmentProfileHistory_MostRecentHostDefaultMeterReadingID_MTMeterReadingsMostRecentHostDefaultMeterReadingID->[dbo].[MTMeterReadings].[MeterReadingID]
FK_SCEquipmentProfileHistory_SerialNumberID_ICSerialNumbersSerialNumberID->[dbo].[ICSerialNumbers].[LookUpID]
FK_SCEquipmentProfileHistory_ShTrackingConfigID_ShTrackingConfigsShTrackingConfigID->[dbo].[ShTrackingConfigs].[ShTrackingConfigID]
FK_SCEquipmentProfileHistory_StatusID_ShEntryTypesStatusID->[dbo].[ShEntryTypes].[ShEntryTypeID]
FK_SCEquipmentProfileHistory_TechnicianID_SCTechniciansTechnicianID->[dbo].[SCTechnicians].[TechnicianID]
FK_SCEquipmentProfileHistory_TerritoryID_SCTerritoriesTerritoryID->[dbo].[SCTerritories].[TerritoryID]
CREATE TABLE [dbo].[SCEquipmentProfileHistory]
(
[EquipmentProfileHistoryID] [int] NOT NULL IDENTITY(1, 1),
[EquipmentHistoryID] [int] NOT NULL,
[EquipmentID] [int] NOT NULL,
[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,
[SerialNumberID] [int] NULL,
[SerialNumberIDLocked] [bit] NOT NULL CONSTRAINT [DF_SCEquipmentProfileHistory_SerialNumberIDLocked] DEFAULT ((0)),
[CustomerID] [int] NOT NULL,
[BillToID] [int] NOT NULL,
[BillCodeID] [int] NULL,
[ResponseTime] [int] NOT 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,
[StatusID] [int] NULL,
[ConditionID] [int] NULL,
[CurrentStatusHistoryID] [int] NULL,
[UnReviewed] [bit] NOT NULL CONSTRAINT [DF_SCEquipmentProfileHistory_UnReviewed] DEFAULT ((0)),
[BranchID] [int] NOT NULL,
[Remarks] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Active] [bit] NOT NULL,
[ParentID] [int] NULL,
[Hosting] [bit] NOT NULL CONSTRAINT [DF_SCEquipmentProfileHistory_Hosting] DEFAULT ((0)),
[Attached] [bit] NOT NULL CONSTRAINT [DF_SCEquipmentProfileHistory_Attached] DEFAULT ((0)),
[BinID] [int] NULL,
[FillerRecordOnly] [bit] NOT NULL CONSTRAINT [DF_SCEquipmentProfileHistory_FillerRecordOnly] DEFAULT ((0)),
[ModelID] [int] NOT NULL,
[IsMetered] [bit] NOT NULL,
[DefaultMeterID] [int] NULL,
[RequireMeteronServiceCalls] [bit] NOT NULL,
[ShTrackingConfigID] [int] NULL,
[MostRecentDefaultMeterReadingID] [int] NULL,
[MostRecentDefaultMeterReadingDisplay] [decimal] (18, 6) NULL,
[MostRecentDefaultMeterReadingDate] [datetime] NULL,
[MostRecentHostDefaultMeterReadingID] [int] NULL,
[MostRecentHostDefaultMeterReadingDisplay] [decimal] (18, 6) NULL,
[MostRecentHostDefaultMeterReadingDate] [datetime] NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SCEquipmentProfileHistory_CreateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [PK_SCEquipmentProfileHistory] PRIMARY KEY CLUSTERED  ([EquipmentProfileHistoryID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_BillCodeID_SCBillCodes] FOREIGN KEY ([BillCodeID]) REFERENCES [dbo].[SCBillCodes] ([BillCodeID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] WITH NOCHECK ADD CONSTRAINT [FK_SCEquipmentProfileHistory_BillToID_ARCustomers] FOREIGN KEY ([BillToID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_BinID_ICBins] FOREIGN KEY ([BinID]) REFERENCES [dbo].[ICBins] ([BinID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_BranchID_GLBranches] FOREIGN KEY ([BranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_ConditionID_SCEquipmentConditions] FOREIGN KEY ([ConditionID]) REFERENCES [dbo].[SCEquipmentConditions] ([SCEquipmentConditionID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_CurrentStatusHistoryID_SCEquipmentHistory] FOREIGN KEY ([CurrentStatusHistoryID]) REFERENCES [dbo].[SCEquipmentHistory] ([SCEquipmentHistoryID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] WITH NOCHECK ADD CONSTRAINT [FK_SCEquipmentProfileHistory_CustomerID_ARCustomers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_DefaultMeterID_MTMeters] FOREIGN KEY ([DefaultMeterID]) REFERENCES [dbo].[MTMeters] ([MeterID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_EquipmentHistoryID_SCEquipmentHistory] FOREIGN KEY ([EquipmentHistoryID]) REFERENCES [dbo].[SCEquipmentHistory] ([SCEquipmentHistoryID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_ItemID_ICItems1] FOREIGN KEY ([ItemID]) REFERENCES [dbo].[ICItems1] ([ItemID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] WITH NOCHECK ADD CONSTRAINT [FK_SCEquipmentProfileHistory_LocationID_ARCustomers] FOREIGN KEY ([LocationID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_MostRecentDefaultMeterReadingID_MTMeterReadings] FOREIGN KEY ([MostRecentDefaultMeterReadingID]) REFERENCES [dbo].[MTMeterReadings] ([MeterReadingID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_MostRecentHostDefaultMeterReadingID_MTMeterReadings] FOREIGN KEY ([MostRecentHostDefaultMeterReadingID]) REFERENCES [dbo].[MTMeterReadings] ([MeterReadingID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_SerialNumberID_ICSerialNumbers] FOREIGN KEY ([SerialNumberID]) REFERENCES [dbo].[ICSerialNumbers] ([LookUpID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_ShTrackingConfigID_ShTrackingConfigs] FOREIGN KEY ([ShTrackingConfigID]) REFERENCES [dbo].[ShTrackingConfigs] ([ShTrackingConfigID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_StatusID_ShEntryTypes] FOREIGN KEY ([StatusID]) REFERENCES [dbo].[ShEntryTypes] ([ShEntryTypeID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_TechnicianID_SCTechnicians] FOREIGN KEY ([TechnicianID]) REFERENCES [dbo].[SCTechnicians] ([TechnicianID])
GO
ALTER TABLE [dbo].[SCEquipmentProfileHistory] ADD CONSTRAINT [FK_SCEquipmentProfileHistory_TerritoryID_SCTerritories] FOREIGN KEY ([TerritoryID]) REFERENCES [dbo].[SCTerritories] ([TerritoryID])
GO
  • [dbo].[v_SCEquipmentHistory]