How to log historical data and/or alarms/events to a database in Microsoft SQL Server

September 3, 2013

y default, both historical data and alarms/events are logged to file-based databases. If it is required that they be stored in a relational database instead, the following steps must be taken:

  1. Choose an existing instance of SQL Server on the computer/network or install a new SQL Server instance. The installation files of Microsoft SQL Server Express Edition (which is for free) are part of Reliance Add-On Pack. After installing Reliance Add-On Pack, choose the respective item from the Reliance Add-On Pack folder in the Windows Start menu.
  2. Run Reliance Design and open the project.
  3. In the Project Options dialog (menu Project > Options…), configure an SQL connection to connect to your SQL server. Click the Edit Connection String button to bring up the Data Link Properties dialog. If SQL Server is installed on the same computer from Reliance Add-On Pack, no changes are necessary. When done, click the Test Connection button. If the configuration is correct, the "Test connection succeeded" message is displayed.
  4. Project Options – SQL connection

    Project Options – SQL connection

    Data Link Properties

    Data Link Properties

  5. In the Data Table Manager (menu Managers > Data Table Manager), change the Database type property to SQL for all data tables that should be stored in a relational database.
  6. Data Table Manager – Database type

    Data Table Manager – Database type

  7. In the Project Structure Manager (menu Managers > Project Structure Manager), select the previously configured SQL connection for the respective data tables.
  8. Project Structure Manager – Data Tables – SQL connection

    Project Structure Manager – Data Tables – SQL connection

  9. In the Project Structure Manager (menu Managers > Project Structure Manager), configure the alarm/event database properties: change the Database type property to SQL and select the previously configured SQL connection.
  10. Project Structure Manager – Alarms/Events – Database type and SQL connection

    Project Structure Manager – Alarms/Events – Database type and SQL connection

An example project named LogDataToSQLServer is part of the Reliance 4 installation. The project is located in the Examples\Databases folder. The Examples folder can be accessed from the Reliance 4 folder on the Windows desktop. For more information on the project, please refer to the file named ProjectInfo_ENU.txt located in the project folder.

Bulb, icon

Tip:

Haven't found what you were looking for? Use this form to inform us about it.

Related links


Example projects

Technical articles

Video tutorials

Try the Reliance SCADA system right now!

Try the Reliance SCADA/HMI system on several sample visualizations.

Try the Reliance SCADA/HMI system on several sample visualizations or download the trial version installer to your computer for free.

Try the Reliance SCADA system right now Try the Reliance SCADA system right now Try the Reliance SCADA system right now