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.
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
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.
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.
pymssql 0.8.0 on *BSD, Linux and Windows were successfully tested with:
Current version is pymssql v0.8.0 released 2006-09-24.
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.
- Python 2.4 or newer, 2.5 confirmed, but only with pymssql 0.8.0 or newer.
- Linux, *nix and Mac OS X: FreeTDS 0.63 or newer.
NOTE: FreeTDS must be configured with --enable-msdblib to return correct dates! See README.freetds for details.- Windows: SQL Developer Tools, to be found on MS SQL 2000 installation media. You need to install MS SQL Client Tools with Developer Tools.
- Windows: Microsoft Visual C++ .NET 2003 or Microsoft Visual Studio .NET 2003. These are usual Python 2.4 build requirements.
- Python 2.4 or newer (the code requires datetime module, and the API functions to manipulate datetime, that's why it won't run on Python earlier than 2.4, thanks Jakub Labath for pointing that out.)
- Linux, *nix and Mac OS X: FreeTDS 0.63 or newer.
NOTE: FreeTDS must be configured with --enable-msdblib to return correct dates! See README.freetds for details.
- Windows: pymssql is equipped with ntwdblib.dll version 2000.80.2087.0 distributed by MS in SQL 2000 post-SP4 hotfix - see KB916287, which supports connecting to MS SQL 2000 and 2005 servers. This library is redistributable -- see REDIST.txt in SQL Server 2000 installation package, or in SQL Server 2000 SP4 installation package.
- You don't have to install full MS SQL Client Tools unless you want to use advanced client configuration tools available in that package.
- NOTE: pymssql doesn't invalidate the requirement for an SQL Client Access Licence for every host you want to run it on, be it Windows or *nix, if your SQL Server is licenced per user or per device connected.
Example script - _mssql module (lower level DB access)
More troubleshooting - link to FreeTDS troubleshooting page; you can find e.g. info on varchar truncation and workaround on that page
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