MS SQL Compact database

This section contains information on the configuration and the data type mapping of Microsoft SQL Compact databases. MS SQL Compact is an ideal database for embedded applications. It has a small footprint but nevertheless provides the required functionality for relational databases.

Compatible versions: Microsoft SQL Compact database 3.5

Declaration in the TwinCAT Database Server Configurator

Microsoft SQL Compact database

Database Type

Select "Microsoft Compact SQL" from the drop-down menu.

Database URL

Enter the name and path of the database. If the database does not yet exist, it can be created with the Create button. Corresponding permissions must exist.

Authentication

Option for logging into the database with a password.

Password

Enter the password.

MS SQL Compact database 1:

Windows CE support

This database is also supported by the Windows CE version of the TwinCAT Database Server. The connection can be established locally.

Data type mapping between DB and PLC

E_ColumnTypes

MS SQL Compact

TwinCAT PLC

BigInt

bigint

T_ULARGE_INTEGER (TcUtilities.lib)

Integer

integer

DINT

SmallInt

smallint

INT

TinyInt

tinyint

SINT

Bit_

bit

BYTE

Money

money

LREAL

Float

float

LREAL

Real_

real

REAL

DateTime

datetime

DT

NText

ntext

STRING

NChar

nchar

STRING

Image

image

ARRAY OF BYTE

NVarChar

nvarchar

STRING

Binary

binary

ARRAY OF BYTE

VarBinary

varbinary

ARRAY OF BYTE

MS SQL Compact database 2:

Data type support

WSTRING is not supported by this database. (See WString support)

Notice

Data security

In flash memory devices the number of write access operations is limited. The flash memory devices can fail, with a risk of data loss.

  • Make regular backups of your system. Use the IPC diagnostics in order to determine the status of the flash memory devices.