Skip to content
Advertisement

Locating ODBC Driver 13.0 for SQL Server on Ubuntu Azure VM

I have a python script that requires ODBC Driver 13.1 for SQL Server to connect and write to a SQL Server. I am trying to setup the script on a Linux VM running Ubuntu 16.04 on Azure. I am having trouble locating the location of the driver to use in my script.

I have followed the instructions here on installing ODBC and it appears to have installed successfully. However, whenever I look for where it has installed on my system, I cannot find it.

On my local machine, I am passing the information to the connection string like so:

JavaScript

On the Linux VM, when I installed ODBC from Microsoft this was a portion of the output

JavaScript

Where is the rest of that file path? When I used find . .../msodbcsql_13.1.9.2-1_amd64.deb it returned no results

In order for the script to function, I need to locate where the driver is on the server so I can pass that path to the script.

Advertisement

Answer

First, please make sure that you have installed unixodbc-dev via apt-get on Azure Ubuntu VM. Then the pymssql or pyodbc module is required by sqlalchemy, you can refer to the offical document Python SQL Driver to install it.

Next, there is my answer for the SO thread Microsoft Azure Data warehouse and SqlAlchemy which you can refer to, and it includes the sample codes as below.

JavaScript

Or

JavaScript

For more details about sqlalchemy with pyodbc or pymssql, please see the SQLAlchemy document for Microsoft SQL Server.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement