Microsoft SQL Server
You can generate data from an edge device, then connect and store the data in the MSSQL database using the DB-Microsoft SQL Server connector. Data is collected from the selected device.
See the following for more information:
Step 1: Add Device
Follow the steps to Connect a Device. The device will be used to store tags that will be eventually used to create outbound topics in the connector. Make sure to select the Enable Data Store check box.
For this use case, select the Simulator device and Simulator (Gen1) driver and enter the name PLC1.
Step 2: Add Tags
After connecting the device in Belden Horizon Data Operations, you can Add Tags to the device. Create tags that you want to use to create outbound topics for the connector.
For this use case, add two tags with the following details.
- Name: Select int-integer.
- Value Type: Select int.
- Tag Name: Enter int_plc1.
- Polling Interval: Enter 1.
- Address: Enter 12.
- Name: Select float-float.
- Value Type: Select float.
- Tag Name: Enter float-plc1.
- Polling Interval: Enter 1.
- Address: Enter 13.
Step 3: Add Microsoft SQL Server Application
Note: The version used in this use case for Microsoft SQL Server is 2017-latest.
To add the Microsoft SQL Server Marketplace Application:
- In Belden Horizon Data Operations, navigate to Applications > Marketplace.
- Click Marketplace List and select Default Marketplace Catalog.
- Click the Microsoft SQL Server application tile.
- From the Installation script version drop-down list, select 2017-CU8-ubuntu.
- Enter MSSQL in the Name field.
- Copy the password from the SA Password field or create a new one and save it for use later.
- Click Launch.
- Navigate to Applications > Catalog Apps. The Microsoft SQL Server application appears, pulls the image, and then starts the application. The MSSQL application shows as running.
- Navigate to Applications > Containers. The MSSQL application Container is running.
- Copy the IP address for the MSSQL application.
Step 4: Add the Microsoft SQL Server Connector
Follow the steps to Add a Connector and select the DB - MIcrosoft SQL Server provider.
Configure the following parameters.
- Name: A recognizable name to identify the connector.
- Hostname: Paste the IP address you copied in Step 3.
- Port: The MSSQL Server port. The default value is 1433.
- Username: Enter sa.
- Password (Optional): Enter the user password you copied in Step 3.
- Database: Enter master.
- Table: Enter test_table.
- Show Mapping: If you want to send data to a custom table, select this check box and unselect Create table. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more. To add key/value pairs for the custom table, see Configure Key/Value Pairs.
- Create table: If you want to send data to an existing table in the default format, or you want to create a new table in the default format, select this check box and unselect Show Mapping. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more.
- Throttling limit: The maximum number of messages per second to be processed. The default value is zero, which means that there is no limit.
- Persistent storage: When enabled, this will cause messages to undergo a store-and-forward procedure. Messages will be stored within Belden Horizon Data Operations when cloud providers are online.
Step 5: Enable the Microsoft SQL Server Connector
To enable the connector:
- Return to the Belden Horizon Data Operations Integration browser tab.
Step 6: Create Topics for Microsoft Connector
You will now need to import the tags created in Step 2 as topics for the Microsoft connector. The topics will be created as outbound topics.
To create outbound topics:
- Click the connector tile. The connector Dashboard appears.
- Click the Topics tab.
After importing the tags, click the toggle in the connector tile to restart the connection.

Step 7: Enable Topics
To enable the topics, return to the Topics tab and click the Enable all topics icon.

Step 8: Create Flow
You can now create a flow in Belden Horizon Data Operations to verify the connection.
To create the flow:
- In Belden Horizon Data Operations, navigate to Flows Manager.
- Drag the Debug node to the canvas and connect the two nodes.
- Double click the DataHub Subscribe node. The Edit DataHub Subscribe Node dialog box appears.
- In the Topic field, paste the topic name copied in Step 6.
- Enter tag imported to mssql db in the Name field.
- If needed, configure the Datahub Subscribe connection. See the "Step 3: Configure Connector Nodes" section in Create a Flow to learn more.
- Click Done.
- Click Deploy.
Step 9: Make Queries in the Container Terminal
To make queries in the container terminal:
- In Belden Horizon Data Operations, navigate to Applications > Containers.
- From the MSSQL container terminal, enter /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <sa password> , and then press ENTER.
- Enter select DB_NAME (), and then press ENTER.
- Enter go, and then press ENTER. The master database name appears.
- Enter go, and then press ENTER. All database names appear.
- Enter use master, and then press ENTER
- Enter go, and then press ENTER. Changed database context to master appears.
- Enter go, and then press ENTER. The Table Catalog for the master database appears.
- Enter select * from test_table, and then press ENTER.
- Enter go, and then press ENTER. Identification Messages from the Tag appear, including the deviceId and registerId at the end of each message.
- Return to the flows canvas browser tab and check the deviceId and registerId to ensure they are the same.



