pymssql module provides access to MS SQL Servers from Python scripts.
It's the most efficient method of accessing MS SQL Server's data from Python scripts. If you care about performance, you can give it a try.
pymssql 0.7.4 has been tested on FreeBSD 6.0, NetBSD 2.1, 3.0, Linux with kernel 2.6, and Windows XP. It should also run on other platforms.
pymssql 0.7.1 has been tested on FreeBSD 5.4 and 6.0, NetBSD 2.0.2, Linux with kernel 2.6, Solaris 10/x86, Mac OS X (thanks Joseph Kocherhans) and Windows XP. It should also run on other platforms.
If you have any experience with other platforms, just let me know and I'll add the info here.
Supported SQL Server versions
pymssql 0.7.4 on *BSD, Linux was successfully tested with SQL Server 2000, all service pack levels.
pymssql 0.7.4 on Windows was successfully tested with SQL Server 2000 RTM, SP3a and SP4, and with SQL Server 2005 RTM (9.00.1399.06).
Here are some key features of "pymssql":
- Supports connecting to MS SQL 2000 and SQL 2005 servers, all editions and service pack levels.
- Supports named instances and non-standard port numbers.
- Great performance: it uses MS SQL DB-Library for C instead of Win32 ODBC.
- Multiple Query/Multiple Result.
- Supports "almost all" of the DB-API 2.0.
- 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...