MS SQL database
This section contains information on the configuration and the data type mapping of Microsoft SQL databases.
Compatible versions: Microsoft SQL database 20xx.
Declaration in the TwinCAT Database Server Configurator
Microsoft SQL database  | |
|---|---|
Database Type  | Select "Microsoft SQL Server" from the drop-down menu.  | 
Provider  | "SQLOLEDB"or the provider of the SQL Native Client, e.g. "SQLNCLI10"  | 
Server  | Enter the name of your SQL server here. Example: "TESTSERVER\SQLEXPRESS"  | 
Database  | Enter the name 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 as a particular user.  | 
User name  | Enter the user name here.  | 
Password  | Enter the corresponding password.  | 
![]()  | Windows CE support This database is also supported by the Windows CE version of the TwinCAT Database Server. The interfacing is not local, but can be established via a network connection.  | 
Data type mapping between DB and PLC
E_ColumnTypes  | MS SQL  | 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  | 
![]()  | Data type support This database supports the data type WSTRING. (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. 
  | 
