Tables [dbo].[MetersHistory]
PropertyValue
Row Count (~)0
Created1:20:03 AM Thursday, March 21, 2019
Last Modified1:20:25 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow Nulls
Cluster Primary Key PK_MetersHistory_AccountID_DeviceID_Year_Month: AccountID\DeviceID\Year\MonthForeign Keys FK_MetersHistory_AccountID_Account_AccountID: [dbo].[Account].AccountIDAccountIDint4
False
Cluster Primary Key PK_MetersHistory_AccountID_DeviceID_Year_Month: AccountID\DeviceID\Year\MonthForeign Keys FK_MetersHistory_DeviceID_Device_DeviceID: [dbo].[Device].DeviceIDDeviceIDint4
False
Cluster Primary Key PK_MetersHistory_AccountID_DeviceID_Year_Month: AccountID\DeviceID\Year\MonthYearsmallint2
False
Cluster Primary Key PK_MetersHistory_AccountID_DeviceID_Year_Month: AccountID\DeviceID\Year\MonthMonthtinyint1
False
Foreign Keys FK_MetersHistory_FirstPrinterAuditID_PrinterAudit_PrinterAuditID: [dbo].[PrinterAudit].FirstPrinterAuditIDFirstPrinterAuditIDint4
False
Foreign Keys FK_MetersHistory_LastPrinterAuditID_PrinterAudit_PrinterAuditID: [dbo].[PrinterAudit].LastPrinterAuditIDLastPrinterAuditIDint4
False
PageCountTotalbigint8
False
PageCountMonobigint8
True
PageCountColorbigint8
True
ContinuousSquareFeetfloat8
True
LinearFeetfloat8
True
TotalAverageVolumefloat8
True
MonoAverageVolumefloat8
True
ColorAverageVolumefloat8
True
ContinuousSquareFeetAveragefloat8
True
LinearFeetAveragefloat8
True
KeyNameKey ColumnsUnique
Cluster Primary Key PK_MetersHistory_AccountID_DeviceID_Year_Month: AccountID\DeviceID\Year\MonthPK_MetersHistory_AccountID_DeviceID_Year_MonthAccountID, DeviceID, Year, Month
True
NameColumns
FK_MetersHistory_AccountID_Account_AccountIDAccountID->[dbo].[Account].[AccountID]
FK_MetersHistory_DeviceID_Device_DeviceIDDeviceID->[dbo].[Device].[DeviceID]
FK_MetersHistory_FirstPrinterAuditID_PrinterAudit_PrinterAuditIDFirstPrinterAuditID->[dbo].[PrinterAudit].[PrinterAuditID]
FK_MetersHistory_LastPrinterAuditID_PrinterAudit_PrinterAuditIDLastPrinterAuditID->[dbo].[PrinterAudit].[PrinterAuditID]
CREATE TABLE [dbo].[MetersHistory]
(
[AccountID] [int] NOT NULL,
[DeviceID] [int] NOT NULL,
[Year] [smallint] NOT NULL,
[Month] [tinyint] NOT NULL,
[FirstPrinterAuditID] [int] NOT NULL,
[LastPrinterAuditID] [int] NOT NULL,
[PageCountTotal] [bigint] NOT NULL,
[PageCountMono] [bigint] NULL,
[PageCountColor] [bigint] NULL,
[ContinuousSquareFeet] [float] NULL,
[LinearFeet] [float] NULL,
[TotalAverageVolume] [float] NULL,
[MonoAverageVolume] [float] NULL,
[ColorAverageVolume] [float] NULL,
[ContinuousSquareFeetAverage] [float] NULL,
[LinearFeetAverage] [float] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MetersHistory] ADD CONSTRAINT [PK_MetersHistory_AccountID_DeviceID_Year_Month] PRIMARY KEY CLUSTERED  ([AccountID], [DeviceID], [Year], [Month]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MetersHistory] ADD CONSTRAINT [FK_MetersHistory_AccountID_Account_AccountID] FOREIGN KEY ([AccountID]) REFERENCES [dbo].[Account] ([AccountID])
GO
ALTER TABLE [dbo].[MetersHistory] ADD CONSTRAINT [FK_MetersHistory_DeviceID_Device_DeviceID] FOREIGN KEY ([DeviceID]) REFERENCES [dbo].[Device] ([DeviceID])
GO
ALTER TABLE [dbo].[MetersHistory] ADD CONSTRAINT [FK_MetersHistory_FirstPrinterAuditID_PrinterAudit_PrinterAuditID] FOREIGN KEY ([FirstPrinterAuditID]) REFERENCES [dbo].[PrinterAudit] ([PrinterAuditID])
GO
ALTER TABLE [dbo].[MetersHistory] ADD CONSTRAINT [FK_MetersHistory_LastPrinterAuditID_PrinterAudit_PrinterAuditID] FOREIGN KEY ([LastPrinterAuditID]) REFERENCES [dbo].[PrinterAudit] ([PrinterAuditID])
GO