On 05-03-2012 11:29, Chris Withers wrote:
Hi All,

What's now the best way to connect to a Microsoft SQL Server instance
from a linux box? What's the recommended driver?

cheers,

Chris



I'm using pyodbc and freetds packages to connect to existing mssql server 2008 running on windows.


here are my configurations:
FreeTDS config:
---------------------
tkizilay@tkizilay-linux:~$ cat /etc/freetds/freetds.conf
[TDS]
Description     = FreeTDS Driver for Linux & MSSQL on Win32
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so


[mssqlserver]
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
host = 192.168.0.10
port = 1433
tds version = 8.0
client charset = UTF-8
-----------------------
and this is /etc/odbc.ini:
------------------
tkizilay@tkizilay-linux:~$ cat /etc/odbc.ini
[MSSQLDB]
Driver = FreeTDS
Description = mssql server
Trace           = No
Servername      = mssqlserver
convert_unicode=True
client charset = utf8
-------------------

and this is the connection setup in python:
----------
engine=create_engine('mssql+pyodbc://SQLUSER:SQLPASSWORD@MSSQLDB?Database=TEST_DB')
DeclarativeBase = declarative_base()
metadata = DeclarativeBase.metadata
metadata.bind = engine

-------

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to