Hello @Marsh, Christopher (Chris.Marsh@yokogawa.com) ,
Thanks for your question.
I recommend using ODBC, specifically the Microsoft ODBC Driver for SQL Serve.
- ODBC and OLE-DB: These are low-level, native C++ APIs. They talk directly to the database with no middlemen, making them the fastest options. Microsoft officially recommends ODBC as the standard for native C++ data access.
- ADO: This is a high-level wrapper built on top of OLE-DB to make coding easier. Because it adds an extra layer of translation, it will always be slower than using OLE-DB or ODBC directly.
- ADO.NET: This is designed for .NET languages like C#. Using it in native Visual C++ requires translating data between "unmanaged" native code and "managed" .NET code, which hurts performance.
Because your C++ app and SQL Server are on the exact same server, your biggest performance gain will come from the connection protocol. You should configure your connection string to use the Shared Memory protocol. This bypasses the network completely and moves data directly through the computer's RAM, which may be the fastest possible method.
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.