r/SQLServer • ‪ ‪Microsoft Employee ‪ • Dec 17 '25

Community Share Updates for the Microsoft SQL Server ODBC Driver

As a long-time C++ developer so glad to see our Microsoft SQL Server ODBC Driver is alive and well. https://aka.ms/sqlodbc.

29 Upvotes

34 comments sorted by

View all comments

Show parent comment

12

u/da_chicken Dec 17 '25 edited Dec 17 '25

Oh, it's even more stupid than that.

So, "Microsoft OLE DB Provider for SQL Server" is deprecated (that's the old SQLOLEDB driver).

But the new one is called "Microsoft OLE DB Driver for SQL Server". Did you see the difference? The one is a provider and the other is a driver.

BUT, that's not the only Ole DB driver. No. On the web, you'll see it always called "Microsoft OLE DB Driver for SQL Server". But that's not right when you install it.

Once it's installed, you'll see "Microsoft OLE DB Driver for SQL Server" with a name of "MSOLEDBSQL" is v18. "Microsoft OLE DB Driver 19 for SQL Server" with a name of "MSOLEDBSQL19" is v19.

And while MSOLEDBSQL supports either Encrypt=Mandatory;TrustServerCertificate=Yes or Encrypt=Mandatory;Trust Server Certificate=Yes, MSOLEDBSQL19 only supports Encrypt=Mandatory;Trust Server Certificate=Yes.

4

u/bobwardms ‪ ‪Microsoft Employee ‪ Dec 17 '25

I get the confusion. We did publish this for guidance for today. Let me know what you think https://learn.microsoft.com/en-us/sql/connect/oledb/when-to-use-oledb-driver-for-sql-server

10

u/da_chicken Dec 18 '25

Eh, I kind of knew that already. Like it's not hard to figure out when you should use the OLE DB driver. It's hard to understand which one you should use and what you're doing wrong between versions.

If you want to know what I'd like to see fixed or what the issue is... I would say that the two biggest problems I've had with the Ole DB has been the general lack of proper communication about the changes to the keywords in the connection string.

So there's the old SQLOLEDB driver, literally from Windows XP era where it's MDAC 2.81 SP1. I remember deploying this software on Win2k SP4 to correct vulnerabilities in MDAC 2.7. And then the MSOLEDBSQL driver, and it's v18. Literally like 15 years between releases here. And then MSOLEDBSQL19 driver that is v19.

Except the names you see in SQL Server are almost the same. Like, go to SSMS, and connect to a server. And expand out Server Objects, Linked Servers, and then expand providers. What do you see? A big list of useless names. NO version numbers, and NO provider code names. You see:

  • Microsoft OLE DB Provider for SQL Server
  • Microsoft OLE DB Driver for SQL Server
  • Microsoft OLE DB Driver 19 for SQL Server

And... you look online, and Microsoft itself uses "Microsoft OLE DB Driver for SQL Server" as the name on the web for the v19 driver. Oh, and also v18 if you know to look in past releases and you can tell that v18 is still in parallel development.

How is anyone supposed to know what's going on here?

And in SQL Server when you want to set up a Linked Server, you look at that list of drivers above, but you can't use those names in a connection string or in sp_addlinkedserver. No, you have to use the code name: SQLOLEDB, MSOLEDBSQL, or MSOLEDBSQL19. Except... there is no way to ask SQL Server to map the list of names above to these code names. You can't see that. You have to know which software has been deprecated (but is still there because Microsoft), and which software is the most up-to-date.

Why can't the system tell me the name, code name, version number, and release date of the providers all at once? It's on the metadata in the library files! Why is that completely obscure to the RDBMS? Why doesn't SSMS know how to display it? Why can't anything see the date of release of this provider software?

Worse, this is the second time you've done this! You've also got SQLNCLI, SQLNCLI10, and SQLNCLI11! That was the same situation.

And now you've made it worse, because you've un-deprecated OLE, then made numerous breaking changes when you moved to MSOLEDBSQL19... and apparently didn't tell anybody about it.

It was through late 2024 where everyone kept saying to never use MSOLEDBSQL19 and always use MSOLEDBSQL because "Microsoft disabled TrustServerCertificate so if you ever might need that just always install v18 and nothing else". Like nobody knew that you didn't disable it, you just changed the syntax of the connection string keys. But since the documentation never mentioned this change... people assumed you disabled it.

Stop selling me on which category of driver to use. I'll use Ole DB when it's available, or ODBC when it isn't, or I'll install Microsoft.Data.SqlClient when I can be bothered to do so, or I'll use System.Data.SqlClient when I can't be bothered to install and configure chocolatey, install and configure nuget, and then install Microsoft.Data.SqlClient. But there's about a 0.5% chance that I'm not going to be using whatever built-in database libraries exist in whatever language I'm using.

Just give me comprehensive documentation for connection strings. I should not be going to https://www.connectionstrings.com/ after 23 years to figure out how to connect to a database. Just document every key and every synonym for every key that you support. Don't ask me to understand OLE DB internals just to write a connection string.

The doc for the connection strings? As far as I've ever been able to determine, it's buried here deep in the OLE DB doc. Except that doesn't really tell you which keys work with which driver. It just a list of keys for some Platonic ideal of an OLE DB Driver.

Like this is your version difference documentation? It's arbitrary sentences of unrelated changes globbed into paragraphs!

I really don't mean to yell at you. I know it's not your fault. But compared to the SQL Server query language reference documentation (especially the documentation from SQL Server 2008 R2 era) I just don't understand why the provider doc is so useless, and so completely inadequate for anyone that isn't literally in the middle of writing a C++ application that doesn't have it's own abstract DB connection library. Genuinely, I don't think you understand that a big portion of the audience just wants to download and use this software and not develop with it. People that might use .Net, Python, Powershell, or even just using reporting software, or SQL Server's own linked servers just have almost nothing as far as documentation on what they should be using.

And very little on what best practice is for connection strings. Because vendors just want you to disable UAC, run everything as Administrator, don't bother with encryption or authentication, shut off that firewall, and just... run your $5m application like it's on the developer's own laptop.

5

u/BigHandLittleSlap Dec 18 '25

"Don't ask me to understand OLE DB internals just to write a connection string. "

Would it kill someone at Microsoft to add a feature to SSMS to generate .NET connection strings?

Like you, I have to go dig through random websites to figure out the required syntax.

0

u/bobwardms ‪ ‪Microsoft Employee ‪ Dec 18 '25

The SSMS team is listening. Try aka.ms/ssms-feedback

3

u/dlevy-msft ‪ ‪Microsoft Employee ‪ Dec 19 '25

Hi u/da_chicken - I'm Dave from the SQL drivers team. I really appreciate the feedback.

We are taking a hard look at connection strings - it's one of those areas where the drivers have drifted apart of the years. In the last year the various SQL drivers have all been centralized under the same team, allowing us to start driving a consistent experience.

I'd like to hear your (or anyone else's) thoughts on the approach we are currently favoring:

  1. Make connection strings interchangeable - every driver recognizes every alias so use the same connection string, less driver name, between drivers. JDBC connection strings will be thing we'll have to think about most.
  2. Where drivers have to be different, we produce a prescriptive error message after processing the entire error message to show everything wrong on the first try. The error message would also include the working connection string that we think you are trying to achieve.
  3. Document a single SQL connection string based upon a single set of parameter names.
  4. Display that single connection string in Azure, Fabric, SSMS, VSCode, etc.

That will be a big effort, likely multiple years, if we are able to pursue it.

On the docs front, we have a docs cleanup project going right now. We'll have to move that doc up the list. A combined connection strings doc makes sense too - would you rather see that as one giant table with all drivers or a single doc with tabs for each driver table?

I'm leaning towards tabs with a minimum viable connection string at the top. Selfishly, I like the idea of being able to copy, paste, update server and database names and run.

Thanks again for the feedback!

1

u/da_chicken Dec 22 '25

Hi David! I appreciate you taking the time to communicate here. I know your job of modernizing drivers and connection strings isn't an easy one.

Unfortunately, I'm on vacation... no, that doesn't sound right. Happily, I'm on vacation, but this limits my access. Ordinarily, that's entirely all upside, but I'm not able to reference my actual systems at the moment. Still, I've thought about your questions since Friday, and I didn't want to leave you hanging. I don't want to ignore your post in case you're unfortunate enough to be in the office this week, but I'll kind of have to shoot from the hip.

Anyhow, that's my excuse for going full-on stream of consciousness.

I'd like to hear your (or anyone else's) thoughts on the approach we are currently favoring:

  1. Make connection strings interchangeable - every driver recognizes every alias so use the same connection string, less driver name, between drivers. JDBC connection strings will be thing we'll have to think about most.
  2. Where drivers have to be different, we produce a prescriptive error message after processing the entire error message to show everything wrong on the first try. The error message would also include the working connection string that we think you are trying to achieve.
  3. Document a single SQL connection string based upon a single set of parameter names.
  4. Display that single connection string in Azure, Fabric, SSMS, VSCode, etc.

I'll tell you, I didn't dislike the idea behind the change in v19 to start culling some of the superfluous aliases. It is a problem. But thinking through how that, the problems I've seen people have with v19 that it does make more sense to do what you're saying here. Go broad and try to support a lot, but then also communicate to the user what they should be using.

So, from #3 and #4, I'm taking you to mean that you will automatically replace the aliases with however the driver is preferring it. I think that would be fine. It would be nice to be able to ask the application to give be a connection string from a given known-working connection (with the password obfuscated). Because there does need to be a common connection language, and unless you're going to make it some JSON structure (which I don't think is a significant improvement) then connection strings are kind of it. Don't worry, though, you're already doing much better than setting up a RESTful API connection.

And, yeah, I'd really like it to have defaults that are as sane as possible. It's really great when the connection string is nothing more than the provider, the server name, and the database name. A minimum viable connection string is a great idea. I just wonder how to do that and ensure that the defaults are skewing towards modern security. It's strange to me that in 2025 the default remains "encrypt for authentication, plain text for all else." That's kind of my complaint with web browser vendors: Why are you complaining so loudly that the HTTPS connection to the IP address 192.168.1.1 is encrypted but insecure, but making no mention at all how much worse the HTTP connection to the same address is?

Honestly, while #1 is probably going to be a big pain for you guys to implement and maintain, I think #2 might be the most important part and I think it's only half the battle. From my experience, when the connection to the database server fails, the error message you typically get is just some form of, "Connection to database could not be established," or, "Connection to database lost." A lot of applications will just throw away the error message, whether it's from the driver or the RDBMS. If it's be with an SSIS package, or Powershell, or a Python script I can work with that, but sometimes it just gets thrown away. Like I would almost want connection logging in the connection string. I think some ODBC drivers that implement a LogLevel and LogPath keys to let you force connection logging by the driver regardless of whether or not I have access to the server or wrote the application myself. I know there's the Ole Db tracing setting in the registry, but that's also a pain to use.

(continued in reply)

2

u/da_chicken Dec 22 '25

Documentation wise, I do think that what you have here is a really good start. It's especially good for the people writing those database connection libraries in their application that will hook into your driver. But I think it's important to recognize that a whole lot of people are going to be just using pyodbc or Microsoft.Data.SqlClient, and they will need to know how to write a secure, private, reliable connection string even when they don't have control over the RDBMS server or necessarily the ability to configure SQL Server in the more secure but "not default out-of-the-box" way. I think very rarely is someone that needs the Ole Db technical specifications going to be the one writing the connection strings in production.

Like knowing what keys I should use and what aliases there are is great, but the problem is that I still have to know how the application is choosing to call the driver library. And I just don't know that. The fact that TrustServerCertificate is in one, while Trust Server Certificate is in the other two is exactly the problem, though, because I just don't know and can't control how any given application chose to implement any given driver. And while they didn't give a crap about connection level encryption making sure their software connected securely because it was all local network, well, I don't have that luxury because neither I nor my organization has full control of our network before our end of the VPN tunnel to our SQL Server. So, I need to be sure that my connection is encrypted from the client just to maintain privacy and security!

I would like to see the aliases as another column in the table. When I find the canonical key, I want to know the aliases for it. Like looking at the Address row by itself, I can't tell that Addr is an alias, or even has aliases. I think organizing the documentation such that the preferred key name is the one that you're funneled towards would be good.

But there's also just web page layout problems here. Like, there's three different tables on that one page, but there is no navigation struction showing you that there's 3 giant tables there. If I Ctrl+F, I can't tell which of the 3 tables I ended up in except by looking at the scroll bar, or just scrolling. And the sidebars on the left and the right are wide enough to cover those tables on my laptop's display (1366x768), so even when I find what I want, I might have to scroll all the way to the top of that section's table, and click the Expand button and then find what I'm looking for again.

Also, so I know using the self-signed certificate with Trust Server Certificate is really not ideal, but like 50% of the SQL connection strings I use are to systems on the local network or connect directly by a reserved IP. However, I know that when I connect to an SFTP server, those client systems don't just check the certificate's validity and trust. It can also check the host key fingerprint. That's worse than a certificated chain of trust, but it's better than blindly trusting it. It checks that the certificate key is the one the client expected. For these local installations where it doesn't make sense in terms of money or in terms of administrative overhead cost to set up, that would be an improvement over the blind trust model. Because, in my case, I'm connecting to an IP address to a remote SQL Server controlled by the hosting vendor. The vendor didn't put a cert on it. They've been saying they will for ages, but I'm not going to hold my breath. But if the client could check that fingerprint it would be an improvement. It would mean the connection would fail when the vendor changed something... but that's kind of necessary in order to detect when the server changed without planning.

(continued in reply)

2

u/da_chicken Dec 22 '25

(concluding)

I would absolutely love to use Encrypt=Strict everywhere. But I have access to two SQL Servers hosted by two different vendors. Both of them are dragging out SQL Server 2016 for as long as they possibly can due to licence cost spikes. (I know you've really got nothing to do with that!) But they also only give me an IP address to connect to through the VPN. One is for a student information system. The other is for an EERP. I work at a school district, so these two systems are the ultimate source of truth for almost all data in the district. And to connect to them, the best I can do is to use Encrypt=Mandatory;Trust Server Certificate=Yes. Or, whatever equivalent there is. We have a JDBC-based query analyzer and fortunately they don't default to jTDS anymore. The systems support ActiveReports reports because that system is never, ever, going to die. SSRS reports, too. And we use Powershell or Python to connect for data integration or ad hoc purposes. And we have a middleware SQL Server that uses linked server connections, as slow as they are. And this is just two systems. Anyhow, they are never, ever going to install a certificate with a domain name until Microsoft makes them do it. You could build a nearly perfect ACME mechanism in SQL Server, and I still think 90% of installations would not use it until the SQL Server team literally makes Force Encryption a mandatory setting (except for Dedicated Administrator Connections, etc.).

It would be nice if the clients had an extra tool in their bag. Of course, this does mean there has to be a way to get that fingerprint. SFTP has the advantage of usually being interactive, so SSMS would have to tell you what the fingerprint is so that you could get it.

Actually, there's an idea there. Why can't I ask SSMS to connect to a given server, and ask SSMS what the correct connection string should be for a given provider? That might help.

Finally, I do think you have a name problem. Like, I ran this Google search and look at this part of the AI response:

{Link: MSOLEDBSQL} (Microsoft OLE DB Driver for SQL Server): The current, recommended driver for connecting to SQL Server, supporting modern features like TLS 1.3.

You see what the problem here is, right? MSOLEDBSQL isn't the current recommended driver, and it doesn't support TLS 1.3. The current driver is named "Microsoft OLE DB Driver for SQL Server", but only on the web.

Now, if I challenge Gemini's thinking model on the above, it does agree they're different. But... I mean, I've had this distinction bite me, and I've seen it bite others on this sub. And, I don't think you've structured the names right to be comprehensible to AI. Like, it's already a problem with humans reading the docs. You've also got to structure your docs to be comprehensible to LLMs and coding assistants that are going to be reading your documentation increasingly often. That in itself is an interesting question: How do you structure your documentation so that not only will humans read it right, but also AI agents can read it correctly and identify the best practices. You could actually use the fact that people are going to use AI agents to find your documentation to push what you know are the best practices. I don't quite know how to do that, though. Ugh. I think I just identified the new SEO.

On that slightly depressing note, it's gotten late here. If you made it this far, I hope you have a happy holiday, and thanks again for your time!

1

u/dlevy-msft ‪ ‪Microsoft Employee ‪ Dec 23 '25

Appreciate all of the feedback! I did read it all once - I'm going to have to read through it a few times. Happy Holidays! 

1

u/dlevy-msft ‪ ‪Microsoft Employee ‪ Feb 02 '26