Odbc Driver Numbers

When you need to actually loop through the records this function returns number of rows in the recordset if and only if you include ORDER BY clause in your query statement. That sounds a bit annoying but thats the work around when dealing with MS SQL odbc driver I guess. Getting latest version of SQL Server ODBC Drivers. 32-bit applications use 32-bit ODBC drivers and 64-bit applications use 64-bit ODBC drivers. Our software uses the highest driver installed, For example, If both SQL server 2005 and 2008 are installed it will use SQL Server 2008 Driver. To Check Version of SQL Server ODBC Driver do the following. Amazon Redshift provides ODBC drivers for Linux, Windows, and macOS X operating systems. Before you install an ODBC driver, determine whether your SQL client tool is 32-bit or 64-bit. Install the ODBC driver that matches the requirements of your SQL client tool. The Get-OdbcDriver cmdlet gets installed Open Database Connectivity (ODBC) drivers from the computer. Specify values for the Name and Platform parameters. If you do not specify a value for Name, the cmdlet gets drivers that have any driver name. If you do not specify any parameters, the cmdlet gets all ODBC drivers installed on the computer. In previous releases of the SAS Drivers for ODBC, it was necessary to edit the TCP/IP services file for the client machine with a service name. The service name was used to define the server name, and the driver used the service name to look up the TCP/IP port number to use for communication with the SAS server.

-->

Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Parallel Data Warehouse

Microsoft ODBC Driver for SQL Server is a single dynamic-link library (DLL) containing run-time support for applications using native-code APIs to connect to SQL Server. Use Microsoft ODBC Driver 17 for SQL Server to create new applications or enhance existing applications that need to take advantage of newer SQL Server features.

Download for Windows

The redistributable installer for Microsoft ODBC Driver 17 for SQL Server installs the client components, which are required during run time to take advantage of newer SQL Server features. It optionally installs the header files needed to develop an application that uses the ODBC API. Starting with version 17.4.2, the installer also includes and installs the Microsoft Active Directory Authentication Library (ADAL.dll).

Version 17.8.1 is the latest general availability (GA) version. If you have a previous version of Microsoft ODBC Driver 17 for SQL Server installed, installing 17.8.1 upgrades it to 17.8.1.

Download Microsoft ODBC Driver 17 for SQL Server (x64)
Download Microsoft ODBC Driver 17 for SQL Server (x86)

Version information

  • Release number: 17.8.1.1
  • Released: July 30, 2021

Note

If you are accessing this page from a non-English language version, and want to see the most up-to-date content, please select Read in English at the top of this page. You can download different languages from the US-English version site by selecting available languages.

Available languages

This release of Microsoft ODBC Driver for SQL Server can be installed in the following languages:

Microsoft ODBC Driver 17.8.1 for SQL Server (x64):
Chinese (Simplified) | Chinese (Traditional) | English (United States) | French | German | Italian | Japanese | Korean | Portuguese (Brazil) | Russian | Spanish

Microsoft ODBC Driver 17.8.1 for SQL Server (x86):
Chinese (Simplified) | Chinese (Traditional) | English (United States) | French | German | Italian | Japanese | Korean | Portuguese (Brazil) | Russian | Spanish

Release notes for Windows

For details about this release on Windows, see the Windows release notes.

Previous releases for Windows

To download previous releases for Windows, see previous Microsoft ODBC Driver for SQL Server releases.

Download for Linux and macOS

The Microsoft ODBC Driver for SQL Server can be downloaded and installed using package managers for Linux and macOS using the relevant installation instructions:
Install ODBC for SQL Server (Linux)
Install ODBC for SQL Server (macOS)

If you need to download the packages for offline installation, all versions are available via the below links.

Note

Packages named msodbcsql17-* are the latest version. Packages named msodbcsql-* are version 13 of the driver.

Odbc driver list

Alpine

  • 17.8.1.1 Alpine package (PGP Signature)
  • 17.7.2.1 Alpine package (PGP Signature)
  • 17.7.1.1 Alpine package (PGP Signature)
  • 17.6.1.1 Alpine package (PGP Signature)
  • 17.5.2.2 Alpine package (PGP Signature)
  • 17.5.2.1 Alpine package (PGP Signature)
  • 17.5.1.1 Alpine package (PGP Signature)

Debian

Red Hat

Suse

Ubuntu

See also Installing the Linux driver.

macOS

  • See the Homebrew formulae for details.

See also Installing the macOS driver.

Older Linux releases

  • Red Hat Enterprise Linux 5 and 6 (64-bit) - Download Microsoft ODBC Driver 11 for SQL Server - Red Hat Linux
  • SUSE Linux Enterprise 11 Service Pack 2 (64-bit) - Download Microsoft ODBC Driver 11 Preview for SQL Server - SUSE Linux
Odbc

Release notes for Linux and macOS

For details about releases for Linux and macOS, see the Linux and macOS release notes.

Before creating python connection to SQL database from windows computer we need to ensure we have correct driver installed. The quickest ways to do this is by opening ODBC Data Source Administrator and selecting Drivers tab as per screenshot below.

In my case I will be connecting to SQL server 2017 therefore I will be using ODBC Driver 17 for SQL Server.

If you are connecting to other databases such as Oracle, MySQL, etc you need to make sure you have correct driver and version (32bit or 64bit) installed otherwise it will not work.

I have seen many connection issues is due to incorrect driver version. For example if you have python 32-bit version installed, you need to make sure you have 32-bit ODBC driver installed otherwise your connection will not work.

If you’re not sure if your python executing 32-bit or 64-bit then you can run the code below and the output will how if it is 32bit or 64 bit version.

Now you know which version of ODBC driver (32-bit or 64-bit) you need to install it, the next step is to install pyodbc package.

pyodbc package will be communicating directly with the ODBC driver.

pyodbc is an open source Python module that makes accessing ODBC databases simple. It implements the DB API 2.0specification but is packed with even more Pythonic convenience.

The easiest way to install is to use pip:

If you’re using IDE PyCharm you can install it from:

File –> Setting –> Project: Name of Your Project –> Project Interpreter

Odbc Driver Name

Click on icon + and install the package, if everything is ok you will receive confirmation Package ‘pyodbc’ installed successfully.

I’m will break down connection string in more meaningful way.

Odbc

Trusted_Connection=no; – Specify if you want connection string to use your windows credentials, if my case no therefore SQL credentials will be used.

Odbc Drivers

DRIVER={ODBC Driver 17 for SQL Server}; – Specify name of the driver from ODBC Data Source Administrator

Odbc Driver Numbers Search

SERVER=.SQLEXPRESS01; – Dot means my local computer and SQLEXPREESS01 is a instants of your SQL server.

PORT=1433; – port number connect to SQL server

Odbc Driver Numbers List

DATABASE=test; – name of the database

UID=USER1; – username of SQL server

Odbc Driver List

PWD=Password; – password of the SQL server user