pymssql — simple MS SQL Python extension module
by 박준철 - Park joon-cheol - Park Joon-cheol (Initial Version Developer)
Andrzej Kukuła Andrzej Kukula (Old Developer)
Damien Churchill Damien Churchill (Active Developer)
pymssql is the Python language extension module that provides access to Microsoft SQL Servers from Python scripts.
It is compliant with Python DB-API 2.0 Specification.
pymssql project has moved to Google Code website at http://code.google.com/p/pymssql/. This page is not maintained and will not be updated anymore. Its contents is outdated and relevant to old versions. Latest stable release on this site is 1.0.2.

Compilation and installation from source

If you need to compile pymssql, check whether requirements shown below are met, unpack source files to a directory of your choice and issue (as root):
# python setup.py install
This will compile and install pymssql.

Build Requirements

  • Python language. Please check platforms page for version info.
  • Python development package -- when needed by your OS (for example python-dev or libpython2.5-devel).
  • Linux, *nix and Mac OS X: FreeTDS 0.63 or newer (you need freetds-dev or freetds-devel or similar named package -- thanks Scott Barr for pointing that out).
    NOTE: FreeTDS must be configured with --enable-msdblib to return correct dates! See FreeTDS and Dates for details.
  • Windows: SQL Developer Tools, to be found on MS SQL 2000 installation media.
  • Windows: If you compile pymssql for Python 2.4 or 2.5, you need either Microsoft Visual C++ .NET 2003 or Microsoft Visual Studio .NET 2003. It will complain if you will try to use newer versions.
  • Windows: If you compile pymssql for Python 2.6 or newer, you need Microsoft Visual Studio 2005 or Microsoft Visual Studio 2008. I think that downloadable Microsoft Visual C++ Express edition can be used.

Platform-specific issues

Mandriva Linux

If you use some older versions of Mandriva Linux and want to compile pymssql, you may have to edit setup.py and change:
    libraries = ["sybdb"]
into:
    libraries = ["sybdb_mssql"]
Be sure to install libfreetds_mssql0 package first.

Windows

FreeTDS on Windows is not supported.


Please also consult FreeTDS and Dates document.