pymssql - Simple MSSQL Python extension module

by 박준철 (Initial Version Developer, "박준철" is pronounced "Park joon-cheol")
Andrzej Kukuła (Active Developer)

License change: due to demand from pymssql users author decided to change pymssql licence from GPL to LGPL.
pymssql 0.8.0 is the first version released under LGPL
.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Contents

About pymssql
Supported Platforms
Supported SQL Server versions
Features
Download
Building
Example script - pymssql module (DB API 2.0)
Example script - _mssql module (lower level DB access)
FAQ / Troubleshooting
Links


About pymssql

This module provides access to Microsoft 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.

Supported Platforms

pymssql 0.8.0 has been tested on Linux with kernel 2.6, Windows XP, FreeBSD 6.1, and NetBSD 3.1. It should also run on other platforms. pymssql 0.8.0 has been tested with Python 2.4 and Python 2.5. Warning: previous versions will segfault when compiled and run with Python 2.5.

pymssql 0.7.4 has been tested (among others) on Mac OS X 10.4.7 (thanks Sébastien Arnaud).

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.8.0 on *BSD, Linux and Windows were successfully tested with:

Features

Supports connecting to Microsoft SQL 2000 and SQL 2005 servers, all editions and service pack levels (see also FAQ / Troubleshooting page).
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.

Download

Current version is pymssql v0.8.0 released 2006-09-24.

pymssql download page

Building

If you need to compile pymssql by hand, 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.

Warning: if you're on Mandriva Linux and want to compile pymssql, edit setup.py and change:
libraries = ["sybdb"]
into:
libraries = ["sybdb_mssql"]
Be sure to install freetds_mssql package first.

Build Requirements

Runtime Requirements


Example script - pymssql module (DB API 2.0)

Example script - _mssql module (lower level DB access)


FAQ / Troubleshooting - really useful page

More troubleshooting - link to FreeTDS troubleshooting page; you can find e.g. info on varchar truncation and workaround on that page


Links

Sourceforge.net pymssql project page: www.sourceforge.net/projects/pymssql

Deprecation info on MS SQL 2000 DB-Library for C:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dblibc/dbc_pdc00b_589v.asp

Joon-cheol's another Projects:
(Norae Joe) - wxPython GUI Interface CD Ripper & Encorder
(ExmanIDE) - IDE For Python
(Simin Online) - Online Game

Joon-cheol's Homepage:
http://www.exman.pe.kr



SourceForge Logo