| CARVIEW |
pymssql - Simple MSSQL Python extension module
by 박준철Andrzej Kukuła
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:
- SQL Server 2000 RTM, SP3a, SP4 and post-SP4 (versions 8.00.760, 2139, 2140, and 2187),
- SQL Server 2005 Enterprise Edition RTM and SP1 (versions 9.00.1399.06 and 9.00.2047.00),
- SQL Server 2005 Express Edition SP1 (version 9.00.2047.00).
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.
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
- 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.
Runtime 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 - 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:
https://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:
https://www.exman.pe.kr