﻿CREATE TABLE [dbo].[AnalogDiagnostics](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[DiagnosticRunId] [bigint] NOT NULL,
	[Excitation] [float] NULL,
	[ExcitationStatus] [smallint] NOT NULL,
	[Offset] [float] NULL,
	[OffsetStatus] [smallint] NOT NULL,
	[ActualRange] [float] NULL,
	[ActualRangeStatus] [smallint] NOT NULL,
	[Noise] [float] NULL,
	[NoiseStatus] [smallint] NOT NULL,
	[Shunt] [float] NULL,
	[ShuntStatus] [smallint] NOT NULL,
	[SensorId] [int] NULL,
	[SensorSerialNumber] [nvarchar](50) NOT NULL,
	[DASId] [int] NULL,
	[DASSerialNumber] [nvarchar](50) NOT NULL,
	[DASChannelIdx] [smallint] NOT NULL,
	[UserCode] [nvarchar](50) NOT NULL,
	[UserChannelName] [nvarchar](50) NOT NULL,
	[IsoCode] [nvarchar](50) NOT NULL,
	[IsoChannelName] [nvarchar](50) NOT NULL,
	[ScaleFactor] [float] NOT NULL,
	[CalibrationRecordId] [int] NULL,
	[CalibrationRecordXML] [nvarchar](max) NOT NULL,
	[Timestamp] [DateTime] NOT NULL,
	PRIMARY KEY (Id),
	FOREIGN KEY (DiagnosticRunId) REFERENCES DiagnosticRuns(Id)
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]