databricks install odbc driver connect to sql server 1

databricks install odbc driver connect to sql server

%sh
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get -q -y install msodbcsql17

Here is what the above code is Doing:
1. Importing the pyodbc module
2. Creating a connection to the database
3. Creating a cursor from the connection
4. Executing a query and saving the results in a variable
5. Iterating over the results and printing them

Similar Posts