Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

History (INSQL​.Runtime​.dbo​.History)

  • Last UpdatedMar 10, 2025
  • 7 minute read

Contains one row for each stored tag value.

Column

Data Type

Description

DateTime

datetime2(7) NOT NULL

The timestamp of the returned value. For delta retrieval, this is typically the time at which the value was acquired by the AVEVA Historian. For cyclic retrieval, this is the specific time requested or calculated (using a SQL function).

TagName

(nvarchar(256)) NOT NULL

The unique name of the tag within the AVEVA Historian system.

Value

float NULL

The value of the tag at the timestamp. The value is always NULL for string tags.

vValue

nvarchar(4000) NULL

The value of the analog, discrete, or string tag stored as a sql_variant. Using this column in a query allows you to have values with mixed datatypes as a result.

Quality

tinyint NOT NULL

The basic data quality indicator associated with the data value.

QualityDetail

int NULL

An internal representation of data quality.

OPCQuality

int NULL

The quality value received from the data source.

wwTagKey

int NOT NULL

The unique numerical identifier of a tag within a single AVEVA Historian.

wwRowCount

int NULL

The number of rows to be returned for a specified time period. For cyclic retrieval, the rows are spaced evenly across the time period, and the default row count is 100 rows. For cyclic retrieval, the row count is applied for each tag in a query. This parameter has been deprecated; do not use. Use the wwCycleCount parameter instead.

wwResolution

int NULL

The sampling rate, in milliseconds, for retrieving the data in cyclic mode. The system returns values stored over the requested time period at the interval specified by the resolution. For example, if you specify a 5000 ms resolution, the system queries for all data during the time period and then only returns those values that occur at each 5000 ms interval, starting with the start date and ending with the end date.

wwEdgeDetection

nvarchar(16) NULL

The type of edge detection result set that the query will return. Valid values are NONE, LEADING, TRAILING, and BOTH.

wwOption

nvarchar(512) NULL

Specifies whether to return information about original data, summary data, or gaps in the storage blocks.

Valid values are:

  • AutoSummaryData

  • PrimaryData

  • BlockGaps

wwRetrievalMode

nvarchar(16) NULL

Used to specify how retrieved data is processed before it is returned to the client. Valid values are: CYCLIC, DELTA, FULL, INTERPOLATED, BESTFIT, AVERAGE, MINIMUM, MAXIMUM, INTEGRAL, SLOPE, COUNTER, VALUESTATE, and ROUNDTRIP.

  • FULL = All stored values are returned

  • CYCLIC = All stored data for tags during the specified time interval are returned for the number of retrieval cycles or resolution specified

  • DELTA = Only values that changed during the specified time interval are returned.

    For all other modes, a calculation is performed by the system on the data and the value(s) are returned. The default is CYCLIC for retrieval from analog tables, DELTA for retrieval from discrete and string tables, and default is DELTA for retrieval from the History table, unless the specific retrieval mode implies otherwise. For example, SLOPE always has DELTA characteristics.

wwTimeDeadband

int NULL

The minimum time, in milliseconds, between returned values for a single tag. Applies only to delta retrieval.

wwValueDeadband

float NULL

The percentage of full scale (range), in engineering units. Any value changes that are less than this percentage are not returned. Applies only to delta retrieval. The default is 0.

wwTimeZone

nvarchar(50) NULL

Used to specify the time zone for retrieval. By default, the retrieval subsystem converts the UTC (Universal Time Coordinated) timestamps for the stored data to the local time of the AVEVA Historian computer, including adjustments for daylight savings time. To keep the timestamps in UTC, set the value of wwTimeZone to UTC. To convert the timestamps to a client computer's time zone, set this parameter to the appropriate time zone text key from the TimeZone table.

wwVersion

nvarchar(30) NULL

If the original data values have been modified in the database, use this column to specify which version of the stored data is to be retrieved. Valid values are: ORIGINAL or LATEST. If no parameter is specified, the latest version of the data is retrieved by default. Modification is indicated by the QualityDetail.

wwCycleCount

int NULL

The number of retrieval cycles (sub-intervals) for the specified time period. The cycles will be spaced evenly across the time period. For example, if you specify a cycle count of four, the time period will be divided into four even cycles, and one or more values (depending on the retrieval mode) will be returned per cycle.

wwTimeStampRule

nvarchar(20) NULL

Used to specify whether cyclic results are timestamped at the beginning of the cycle or at the end of the cycle. Valid values are START and END. If no timestamp rule is specified in the query, then retrieval uses the setting of the TimeStampRule system parameter.

wwInterpolationType

nvarchar(20) NULL

Used to determine which analog value to return at a given cycle boundary. Valid values are STAIRSTEP and LINEAR. If STAIRSTEP is specified, no interpolation occurs. The last known point is returned with the given cycle time. If no valid value can be found, a NULL is returned. If LINEAR is specified, the system calculates a new value at the given cycle time by interpolating between the last known value prior to the cycle time and the first value after the cycle time.

wwQualityRule

nvarchar(20) NULL

Used to specify whether values with certain characteristics are explicitly excluded from consideration by data retrieval. This parameter will override the setting of the QualityRule system parameter. Valid values are GOOD, EXTENDED, or OPTIMISTIC.

A quality rule of GOOD means that data values with doubtful (64) OPC quality will not be used in the retrieval calculations and will be ignored. Values with bad QualityDetail indicate gaps in the data.

A quality rule of EXTENDED means that data values with both good and doubtful OPC quality will be used in the retrieval calculations. Values with bad QualityDetail indicate gaps in the data.

A quality rule of OPTIMISTIC means that calculations that include some good and some NULL values will not cause the overall calculations to return NULL.

You can apply wwQualityRule to all retrieval modes.

wwStateCalc

nvarchar(20) NULL

Used to indicate the type of calculation to return in the StateTime column for the "value state" retrieval mode. Valid values are: MINIMUM, MAXIMUM, AVERAGE, TOTAL, or PERCENT. You can also use the shortened versions: MIN, MAX, AVG, or SUM. The default for this column is TOTAL.

StateTime

float NULL

The amount of time in the state, expressed as a float (64-bit) number of milliseconds, for all time-in-state modes except for "Percent." For a time-in-state percentage calculation, this value is the percentage of the total time interval, in the range 0.0 to 100.0, that the value was in the state.

PercentGood

float NULL

The ratio of the number of rows that have "good" quality to the total number of rows in the retrieval cycle, expressed as a percentage in the range 0 to 100.

wwParameters

nvarchar(128) NULL

Contains the "stream index" (used for informational purposes only) and the special index value to indicate that the value was calculated by the "SLR()" filter. SLR stands for "simple linear regression," the algorithm used for predictive retrieval. By default, the value of this parameter is an empty string.

StartDateTime

datetime2 NOT NULL

Start time of the retrieval cycle for which this row is returned.

SourceTag

nvarchar(256) NULL

Returns the name of the source tag for a replicated tag at the time this point was stored. With the SourceServer, this column uniquely identifies the tag from which this replicated point is coming.

SourceServer

nvarchar(256) NULL

Returns the name of the server from which replication occurred for this replicated tag at the time this point was stored.

wwFilter

nvarchar(512) NULL

Gives the name of the filter. Filters are specified as C-like functions and parentheses are always required, even when the filter does not override the default parameters (no parameters are passed). Filter values are NoFilter, ToDiscrete(), SigmaLimit(), SnapTo(), and SLR(). The default value is NoFilter. If the query does not specify the wwFilter element at all, or if its default value is not overridden, then no filter is applied.

wwValueSelector

nvarchar(128) NOT NULL

Used to specify which column to return for specified analog summary tags in the four basic retrieval modes: DELTA, FULL, CYCLIC, and INTERPOLATED. The defined set of selectors are AUTO (the default in all modes if not overridden), MINIMUM or MIN, MAXIMUM or MAX, FIRST, LAST, AVERAGE or AVG, INTEGRAL, and STDDEV or STANDDEVIATION. The default AUTO setting returns the Last attribute in the Value column (which makes it accessible in the WideHistory table). You can only override the selector for the basic retrieval modes.

FIRST, LAST, MIN, and MAX each have their own timestamp that will be used for the time part of the VTQ. AVG, INTEGRAL and STDDEV represent values that hold for the entire cycle so the summary period start time will be used for the time part of a VTQ.

wwMaxStates

int NULL

For internal use only.

wwExpression

nvarchar(4000) NULL

Used to specify an expression for unit of measure conversion, specified in the following format using tag/unit pairs:

UOM(TAG1,UNIT1;TAG2,UNIT2;...)

For example, the expression UOM(DistanceTag,m;TempTag,F;DurationTag,Minute)returns the values for the tag named DistanceTag measured in meters, the values for TempTag measured in degrees Farenheit, and the values for DurationTag measured in minutes.

The following rules apply:

  1. If any of the unit conversions specified are invalid and fail (for example, trying to convert a tag measured in meters to a unit of hours) then no unit conversions are performed.

  2. If any tags specified in the expression for unit conversion are not part of the query, those tags will be ignored for the purpose of unit conversion.

wwUnit

nvarchar(512) NULL

Returns the currently used unit of measure.

Related Links
TitleResults for “How to create a CRG?”Also Available in