skip to navigation
skip to content

pymssql 2.1.1

DB-API interface to Microsoft SQL Server for Python. (new Cython-based version)

Package Documentation

Latest Version: 2.1.3

pymssql - DB-API interface to Microsoft SQL Server

A simple database interface for Python that builds on top of FreeTDS to provide a Python DB-API (PEP-249) interface to Microsoft SQL Server.

Detailed information on pymssql is available on the website:

New development is happening on GitHub at:

There is a Google Group for discussion at:!forum/pymssql

Do you use pymssql?

Can you take a minute and fill out this survey to help us prioritize development tasks?

Recent Changes

Version 2.1.1 - 2014-11-25 - Ramiro Morales


  • Custom message handlers (GH-139)

    The DB-Library API includes a callback mechanism so applications can provide functions known as message handlers that get passed informative messages sent by the server which then can be logged, shown to the user, etc.

    _mssql now allows you to install your own message handlers written in Python. See the _msssql examples and reference sections of the documentation for more details.

    Thanks Marc Abramowitz.

  • Compatibility with Azure

    It is now possible to transparently connect to SQL Server instances accessible as part of the Azure cloud services.


    If you need to connect to Azure make sure you use FreeTDS 0.91 or newer.

  • Customizable per-connection initialization SQL clauses (both in pymssql and _mssql) (GH-97)

    It is now possible to customize the SQL statements sent right after the connection is established (e.g. 'SET ANSI_NULLS ON;'). Previously it was a hard-coded list of queries. See the _mssql.MSSQLConnection documentation for more details.

    Thanks Marc Abramowitz.

  • Added ability to handle instances of uuid.UUID passed as parameters for SQL queries both in pymssql and _mssql. (GH-209)

    Thanks Marat Mavlyutov.

  • Allow using SQL Server autocommit mode from pymssql at connection opening time. This allows e.g. DDL statements like DROP DATABASE to be executed. (GH-210)

    Thanks Marat Mavlyutov.

  • Documentation: Explicitly mention minimum versions supported of Python (2.6) and SQL Server (2005).

  • Incremental enhancements to the documentation.

Bug fixes

  • Handle errors when calling Stored Procedures via the .callproc() pymssql cursor method. Now it will raise a DB-API DatabaseException; previously it allowed a _mssql.MSSQLDatabaseException exception to surface.

  • Fixes in tds_version _mssql connections property value

    Made it work with TDS protocol version 7.2. (GH-211)

    The value returned for TDS version 7.1 is still 8.0 for backward compatibility (this is because such feature got added in times when Microsoft documentation labeled the two protocol versions that followed 7.0 as 8.0 and 9.0; later it changed them to 7.1 and 7.2 respectively) and will be corrected in a future release (2.2).

  • PEP 249 compliance (GH-251)

    Added type constructors to increase compatibility with other libraries.

    Thanks Aymeric Augustin.

  • pymssql: Made handling of integer SP params more robust (GH-237)

  • Check lower bound value when convering integer values from to Python to SQL (GH-238)


  • Completed migration of the test suite from nose to py.test.
  • Added a few more test cases to our suite.
  • Tests: Modified a couple of test cases so the full suite can be run against SQL Server 2005.
  • Added testing of successful build of documentation to Travis CI script.
  • Build process: Cleanup intermediate and ad-hoc anciliary files (GH-231, GH-273)
  • Fixed handling of release tarballs contents so no extraneous files are shipped and the documentation tree is actually included. Also, removed unused code.

Version 2.1.0 - 2014-02-25 - Marc Abramowitz


Bug Fixes

See ChangeLog for older history…

File Type Py Version Uploaded on Size
pymssql-2.1.1-cp26-none-win32.whl (md5) Python Wheel cp26 2014-11-25 252KB
pymssql-2.1.1-cp26-none-win_amd64.whl (md5) Python Wheel cp26 2014-11-25 282KB
pymssql-2.1.1-cp27-none-win32.whl (md5) Python Wheel cp27 2014-11-25 252KB
pymssql-2.1.1-cp27-none-win_amd64.whl (md5) Python Wheel cp27 2014-11-25 282KB
pymssql-2.1.1-cp33-none-win32.whl (md5) Python Wheel cp33 2014-11-25 252KB
pymssql-2.1.1-cp33-none-win_amd64.whl (md5) Python Wheel cp33 2014-11-25 279KB
pymssql-2.1.1-cp34-none-win32.whl (md5) Python Wheel cp34 2014-11-25 252KB
pymssql-2.1.1-cp34-none-win_amd64.whl (md5) Python Wheel cp34 2014-11-25 279KB
pymssql-2.1.1-py2.6-win-amd64.egg (md5) Python Egg 2.6 2014-11-25 278KB
pymssql-2.1.1-py2.6-win32.egg (md5) Python Egg 2.6 2014-11-25 249KB
pymssql-2.1.1-py2.7-win-amd64.egg (md5) Python Egg 2.7 2014-11-25 279KB
pymssql-2.1.1-py2.7-win32.egg (md5) Python Egg 2.7 2014-11-25 248KB
pymssql-2.1.1-py3.3-win-amd64.egg (md5) Python Egg 3.3 2014-11-25 276KB
pymssql-2.1.1-py3.3-win32.egg (md5) Python Egg 3.3 2014-11-25 249KB
pymssql-2.1.1-py3.4-win-amd64.egg (md5) Python Egg 3.4 2014-11-25 276KB
pymssql-2.1.1-py3.4-win32.egg (md5) Python Egg 3.4 2014-11-25 249KB
pymssql-2.1.1.tar.gz (md5) Source 2014-11-25 2MB (md5) MS Windows installer 2.6 2014-11-25 508KB (md5) MS Windows installer 2.7 2014-11-25 508KB (md5) MS Windows installer 3.3 2014-11-25 504KB (md5) MS Windows installer 3.4 2014-11-25 504KB
pymssql-2.1.1.win32-py2.6.exe (md5) MS Windows installer 2.6 2014-11-25 451KB
pymssql-2.1.1.win32-py2.7.exe (md5) MS Windows installer 2.7 2014-11-25 451KB
pymssql-2.1.1.win32-py3.3.exe (md5) MS Windows installer 3.3 2014-11-25 447KB
pymssql-2.1.1.win32-py3.4.exe (md5) MS Windows installer 3.4 2014-11-25 447KB