Accessing SQL Server using Python and Linux

pymssql vs pyodbc

Choose pyodbc, even if it takes you longer to setup FreeTDS, unixodbc and all these exotic configuration files, trust me, it will be better on the long run.

An SQLAlchemy query is unable to find a column

You are probably running on the old TDS protocol. Either edit the "tds version" variable in your freetds.conf file or you can:


Here is an example of SQLAlchemy connection string using this:



If you are using SQLAlchemy, you can do the following to query components of a DateTime column:

from sqlalchemy.sql.expression import extract

year_col = extract("year", meta.table.c.createddate)

Last updated: 2011-02-15