Monday, May 21, 2012

Connect to SQL Server from Ubuntu

Connecting an Ubuntu box to a MS SQL Server can by achieved through the FreeTDS ODBC driver.

Here goes a small recipe to install it:

sudo apt-get update
sudo apt-get install tdsodbc
sudo apt-get install unixodbc unixodbc-dev
sudo apt-get install python-setuptools
sudo easy_install pyodbc
sudo echo -e "[FreeTDS]\nDriver=/usr/lib/odbc/" >> /etc/odbcinst.ini

Now you can open a Python interpreter and test the connection using pyodbc.
This may speed you up if you're trying to import SQL Server data to OpenERP.

No comments:

Post a Comment