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.
You are probably running on the old TDS protocol. Either edit the "tds version" variable in your freetds.conf file or you can:
Reference: http://lists.ibiblio.org/pipermail/freetds/2008q2/023126.html
Here is an example of SQLAlchemy connection string using this:
mssql+pyodbc://user:password@localhost/MyDatabase?port=1443&tds_version=8.0
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) meta.session.query(year_col).all()
Last updated: 2011-02-15