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

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!