6.4 Database (SQL Server)
A Database controller reads values from a Microsoft SQL Server table or view. It is read only: tags cannot be written, and the write box is not shown.
|
Field
|
Description
|
|
Database Table Name
|
The table or view to read. A name that includes its schema works — for example Logging.DataLog — with or without square brackets. A name with no schema is looked for in dbo, so a table in another schema will not be found unless you include its schema.
|
|
Connection String
|
How to reach the database. An example is shown in the box: Server=192.168.1.20;Database=Production;User Id=user;Password=pass;TrustServerCertificate=True. The server must be given as an IP address, not a computer name — phones cannot look up computer names on a plant network.
|
|
IP Address
|
Filled in automatically from the connection string, and cannot be edited. It shows Invalid IP address if the connection string names a computer instead of an IP address.
|
|
Port
|
Default 1433. The port entered here is used, and takes priority over any port written in the connection string. A named instance, such as Server=192.168.1.20\SQLEXPRESS, is left as written.
|
|
Timestamp
|
The column that shows which row is the latest. Any column that can be sorted will work, but a date and time column is what makes "latest" mean the most recent reading.
|
|
Connection Timeout
|
In milliseconds. On some networks the first connection takes more than 5 seconds; if a database controller will not connect, raising this is the first thing to try.
|
How to set up the tags for a table is explained in Database Tags.
|