pymssql — simple MS SQL Python extension module
by 박준철 - Park joon-cheol - Park Joon-cheol (Initial Version Developer)
Andrzej Kukuła Andrzej Kukula (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 is hosted on Sourceforge.net.

News


2009-04-28: pymssql 1.0.2 has been released.
  • fixed severe bug introduced in 1.0.0 that caused some queries to be truncated or overwritten with binary garbage - many thanks to Igor Nazarenko who found the exact cause of the bug,
  • fixed bug - if a query batch contained DECLARE or possibly some other T-SQL statements, query results were not available (DECLARE yielded additional result with no columns) - thanks Corey Bertram and Wes McKinney,
  • fixed incompatibility - a % character in query without parameters is treated like any other character; it gains its special meaning as a formatting specifier only if any arguments are given. This allows for straightforward queries similar to the following: SELECT * FROM sysobjects WHERE name LIKE 's%',
  • updated Nagios plugin - thanks Josselin Mouette for the patch,
  • pymssql on Linux/*NIX understands BIGINT natively - thanks Alexandr Zamaraev for the patch (on Windows it is returned as SQLNUMERIC data type by the DB Library, which is converted to Python Decimal value),
  • new feature: pymssql.connect() method understands new argument: as_dict - which allows to return rows as dictionaries instead of tuples - thanks Daniel Watrous for the idea and draft patch,
  • new feature: pymssql.connect() and _mssql.connect() methods understand new argument: max_conn - which helps increase the default 25 concurrent connections limit - thanks Daniel Watrous for the idea and draft patch,
  • important doc update: documented that with the technology pymssql currently uses (DB Library for C), it is not possible to read or write BLOBs longer than 4096 bytes,
  • further webpage changes to improve access to information.
If you find any problems, please consult Documentation page, then Support information. In any case just send me an e-mail if you want.

2009-02-05: pymssql 1.0.1 has been released.
  • fixed bug in execute() function introduced in 1.0.0,
  • added Nagios plugin, thanks to Josselin Mouette and Julien Blache from Debian team,
  • some 64-bit issues were fixed,
  • charset bug was fixed, thanks again Josselin Mouette,
  • pymssql was tested on more platforms, see Platforms page for details.
If you find any problems, please consult Support information. In any case just send me an e-mail if you want.

2009-01-29: pymssql 1.0.0 has been released. It was almost rewritten from scratch, and it addresses all requests that I received from users. There are many new features, improvements, bugfixes and cleanups:
  • pymssql no longer fetches all rows into memory, instead it implements convenient iterators that get data from SQL server row by row,
  • row data is a dictionary that can be accessed by column index or column name,
  • identity value of last inserted row can be obtained easily,
  • number of rows affected by last database operation is available,
  • it is possible to connect to database using Windows Authentication (so called "trusted connection") on Windows,
  • more DB-API extensions has been implemented: .lastrowid, .rownumber, .connection, cursor iterators (see DB-API Specification if you're interested), and the scripts that used pymssql DB-API compliant methods will continue to work,
  • _mssql module has many new convenient features, see Documentation and examples for details,
  • exceptions and return codes have been reworked to be more intuitive and usable,
  • the module now has decent inline documentation: just use help(pymssql) or help(_mssql) to see many notes and examples,
  • pymssql 1.0.0 is compatible with Python 2.4, 2.5 and 2.6,
  • tested with SQL 2000, SQL 2005, and SQL 2008,
  • BEWARE however, if you were using the lower level _mssql module, it changed in incompatible way. You will need to change your scripts, or continue to use pymssql 0.8.0. This is why major version number was incremented.
The webpage is also new, there is reference documentation, more examples, and notes. I hope it will be easy to navigate and readable.

If you find any problems, please consult Support information. In any case just send me an e-mail if you want.