Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 109779336, Entry date: 05/13/2020

Connecting an S7-1200 / S7-1500 to an SQL Database

  • Entry
  • Associated product(s)
The Tabular Data Stream protocol (TDS) gives you the ability to establish a direct connection with a Microsoft SQL server. Using TDS, you can log in to an SQL server database and transmit SQL instructions. In this way it is possible to read data from the database, or send them to the database for storage.

This application example demonstrates how a SIMATIC S7-1200 or S7-1500 establishes a connection to a Microsoft SQL server via TDS and sends data to a database using "Open User Communication blocks" (TCON, TSEND, TRCV and TDISCON).

The SQL function "SELECT" will be available with the next version of this article at the end of august 2020!

  Documentation (912,7 KB)
 Registrierung notwendig  Project TIA Portal V16 (3,5 MB)

Last changes

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.