Microsoft SQL Database

The values of the variables are saved in a Microsoft SQL database.
Compatible versions: Microsoft SQL Database 2000/2005/2008. Declarations see "Declarations different Databases"

The variable values are saved in the following table structure.

Column name

Data type

Null permitted

Characteristic

ID

bigint

no

IDENTITY(1,1)

Timestamp

datetime

no

 

Name

ntext

no

 

ValueType="Double"

Value

float

no

 

ValueType="Bytes"

Value

varbinary

no

 

An AutoID is generated in the "ID" column. The value in this column is, in other words, always increased by 1. This functionality makes the IDENTITY property possible.
The "Timestamp" column stores the time at which the data record was saved.
The name of the variable is stored in the "Name" column.
The "Value" column stores the value of the variable.

The table is created with the following SQL command:

/*ValueType="Double"*/
CREATE TABLE myTable(
    ID          bigint IDENTITY(1,1)   NOT NULL,
    Timestamp   datetime               NOT NULL,
    Name        ntext                  NOT NULL,
    Value       float                  NOT NULL
)

/*ValueType="Bytes"*/
CREATE TABLE myTable(
    ID          bigint IDENTITY(1,1)   NOT NULL,
    Timestamp   datetime               NOT NULL,
    Name        ntext                  NOT NULL,
    Value       varbinary              NOT NULL
)

E_DBColumnTypes

MS  SQL

PLC Control

eDBColumn_BigInt

bigint

T_ULARGE_INTEGER (TcUtilities.lib)

eDBColumn_Integer

integer

DINT

eDBColumn_SmallInt

smallint

INT

eDBColumn_TinyInt

tinyint

SINT

eDBColumn_Bit

bit

BYTE

eDBColumn_Money

money

LREAL

eDBColumn_Float

float

LREAL

eDBColumn_Real

real

REAL

eDBColumn_DateTime

datetime

DT

eDBColumn_NText

ntext

STRING

eDBColumn_NChar

nchar

STRING

eDBColumn_Image

image

ARRAY OF BYTE

eDBColumn_NVarChar

nvarchar

STRING

eDBColumn_Binary

binary

ARRAY OF BYTE

eDBColumn_VarBinary

varbinary

ARRAY OF BYTE