ODBC Driver 17.4 for SQL Server Released
Published Aug 01 2019 01:48 PM 16.3K Views
Steel Contributor

Version 17.4 of the Microsoft ODBC Driver 17 for SQL Server has been released. Version 17.4 brings several added features and fixed issues.

 

Added

  • Support for Always Encrypted with Secure Enclaves
  • Support for dynamic loading of OpenSSL (on Linux/macOS)
  • Support for insertion of UTF-8 data against SQL Server 2019
  • Support for configuring TCP Keep Alive settings
  • Support for Debian 10
  • Support for RedHat 8
  • Support for Ubuntu 19.04
  • Support for connecting to named instances on Linux and macOS

Fixed

  • Intermittent hang when Multiple Active Results Sets (MARS) is enabled
  • Connection resiliency hang when async notification is enabled
  • Crash when retrieving diagnostic records for multithreaded connection attempts
  • 'Encryption not supported' upon reconnect after calling SQLGetInfo() with SQL_USER_NAME and SQL_DATA_SOURCE_READ_ONLY
  • COM initialization error during Azure Active Directory Interactive Authentication
  • SQLGetData() for multi-byte UTF-8 data
  • Retrieving length of sql_variant columns using SQLGetData()
  • Importing of sql_variant columns containing more than 7992 bytes using bcp
  • Sending of correct encoding to server for narrow character data

Next steps

For Windows installations, you can directly download the Microsoft ODBC Driver 17 for SQL Server.

Linux and macOS packages are also being made available. For installation details see the online instructions.

 

Roadmap

We are committed to improving quality and bringing more feature support for connecting to SQL Server Azure SQL Database Azure SQL DW, and Azure SQL Managed Instance through regular driver releases. We invite you to explore the latest the Microsoft Data Platform has to offer via a trial of Microsoft Azure SQL Database or by evaluating Microsoft SQL Server.

David Engel

12 Comments
Bronze Contributor

This may or may not be expected, but I saw it on two unrelated systems (Win10, Server 2016), so it couldn't have been a fluke. I chose the upgrade method, over a v17 from 2018. It completed fine. However, the system DSN I had no longer worked. Furthermore, when I went to create a new one (with odbcad32.exe), the UI to do so after clicking System/Add/driver never actually appeared.

 

Clearly, something was wrong. So I ran the installer again, this time choosing repair. In both installations, that worked.

Steel Contributor

@Brian . Do you happen to know which 17.x version you upgraded from? I recall there was an issue with one of the first 17.x releases that basically required an uninstall/reinstall to fix the upgrade for any subsequent 17.x install.

Bronze Contributor

v17.0.1.1 (installed Feb 11, 2018), which probably explains it then. That may not have been the very first v17, but it was close.

Copper Contributor
I have updated my mssql and all tools yesterday and it stopped working. Server itself seems to be fine but I'm not able to connect locally or remotely. sqlcmd -S localhost returns this: hyperqbe@slaro:/etc$ sqlcmd -S localhost Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2749. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.. When I use IP the error is slightly different: hyperqbe@slaro:/etc$ sqlcmd -S 192.168.1.141 Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.
Bronze Contributor

@hyperqbe Could that be the same thing that I found?  Run the installer again and choose "repair" and re-test.

Steel Contributor

@Brian . He's on Linux, so he's using the Linux packages.

 

@hyperqbe It doesn't really sounds like a driver issue. Are you sure connectivity to the server is fine? Can you test from another server? Try reverting to the previous version of the driver and tools to see if you still get the error?

Copper Contributor
I reinstalled the sql-server completely and removed the old /var/opt/mssql/data. I'm still getting the errors: Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection. I have below packages with "odbc" in name. I'm wondering if any of those could be causing conflicts. hyperqbe@slaro:~$ apt list --installed|grep odbc erlang-odbc/bionic,now 1:20.2.2+dfsg-1ubuntu2 amd64 [zainstalowany,automatycznie] libodbc1/xenial,now 2.3.7 amd64 [zainstalowany,automatycznie] msodbcsql17/xenial,now 17.4.1.1-1 amd64 [zainstalowany,automatycznie] odbcinst/xenial,now 2.3.7 amd64 [zainstalowany,automatycznie] odbcinst1debian2/xenial,now 2.3.7 amd64 [zainstalowany,automatycznie] unixodbc/xenial,now 2.3.7 amd64 [zainstalowany,automatycznie] unixodbc-dev/xenial,now 2.3.7 amd64 [zainstalowany] /etc/obdcinst.ini has one entry: hyperqbe@slaro:~$ cat /etc/odbcinst.ini [ODBC Driver 17 for SQL Server] Description=Microsoft ODBC Driver 17 for SQL Server Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.4.so.1.1 UsageCount=1 I don't have /etc/odbc.ini or ~/.odbc.ini files.
Copper Contributor
I've added ~/.odbc.ini and /etc/odbc.ini files. Still unable to connent. Tried with "bcp master.INFORMATION_SCHEMA.TABLES out OutFile.dat -S" but result was SQLState = 08001, NativeError = 10054 Error = [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746 SQLState = 08001, NativeError = 10054 Error = [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
Copper Contributor
I enabled tracing and got this at the very bottom of trace file: [ODBC][25090][1565445958.576898][SQLGetConnectAttrW.c][211]Error: SQL_INVALID_HANDLE Additionally I know it detects the server itself because there's this entry somewhere in the middle: [ODBC][25090][1565445958.570105][SQLDriverConnectW.c][290] Entry: Connection = 0x2616080 Window Hdl = (nil) Str In = [DRIVER={ODBC Driver 17 for SQL Server};SERVER={slaro};Trusted_Connection={YES};WSID={slaro};APP={SQLCMD};][length = 105 (SQL_NTS)] Str Out = (nil) Str Out Max = 0 Str Out Ptr = (nil) Completion = 0 UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UTF-16LE' I'm not sure if ASCII 'ANSI_X3.4-1968' is not causing the problem. It was mentioned in documentation that this should say "UTF-8".
Copper Contributor

After adding to my Ubuntu 18.04 system Microsoft's repository

deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main

in /etc/apt/sources.list.d/mssql-release.list, I now get two versions of the unixodbc package offered:

$ apt-cache showpkg unixodbc
Package: unixodbc
Versions: 
2.3.7 (/var/lib/apt/lists/packages.microsoft.com_ubuntu_18.04_prod_dists_bionic_main_binary-amd64_Packages) (/var/lib/dpkg/status)
[...]
2.3.4-1.1ubuntu3 (/var/lib/apt/lists/www-uxsup.csx.cam.ac.uk_pub_linux_ubuntu_dists_bionic_universe_binary-amd64_Packages)
[...]
Dependencies: 
2.3.7 - libc6 (2 2.14) odbcinst1debian2 (2 2.3.7) libodbc1 (2 2.3.7) unixodbc-bin (3 2.3.7) unixodbc-bin:i386 (3 2.3.7) unixodbc:i386 (32 (null)) 
2.3.4-1.1ubuntu3 - libc6 (2 2.14) libodbc1 (2 2.3.1) libreadline7 (2 6.0) odbcinst1debian2 (2 2.3.1) unixodbc-bin (3 2.2.4-1) unixodbc-bin:i386 (3 2.2.4-1) unixodbc:i386 (32 (null)) 
[...]

So it seems both Microsoft and Ubuntu provide versions of the unixodbc package, which contains the isql tool. And the system install Microsoft's unixodbc by default (because of the higher version number?).

But the two are not equivalent:

As you can see from the above dependencies, Ubuntu's unixodbc-2.3.4-1ubuntu3 has been linked against the libreadline7 library, such that the isql tool uses the readline command-line editor and therefore can deal with cursor movements, which is extremely convenien.

Unfortunately, Microsoft's unixodbc-2.3.4 was not linked with libreadline7, and therefore sadly does not support any cursor keys in its built-in command prompt (e.g., for inline editing or to access previous command history).

Why does Microsoft have to provide an alternate version of unixodbc (isql) under the same package name?

If you must provide your own version of unixodbc (isql) for some reason, could you please also compile it with readline support included, like the Ubuntu version?

 

Steel Contributor

@mgkuhn Microsoft provides unixodbc because version 2.3.7 includes many bug fixes that we have contributed fixes for which affect a lot customers (see the long list of bug fixes at unixodbc.org). The alternative is to tell customers to compile unixodbc manually or wait until Ubuntu/Red Hat/Suse/Debian provide an update (note: 2.3.4 is from 2015!). I'll forward your request regarding libreadline7 on to the ODBC driver team to see if we can incorporate it into future releases.

Steel Contributor

@mgkuhn To add to that, we built the unixodbc package with the default, minimal options to be as compatible as possible across distributions and avoid unnecessary dependencies. You have some options. You can install unixodbc 2.3.4 first and then install the driver and they will work together. I would also suggest installing mssql-tools and using sqlcmd. Sqlcmd has more functionality than isql and the cursor keys work there.

Version history
Last update:
‎Feb 19 2020 03:08 PM
Updated by: