By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,814 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,814 IT Pros & Developers. It's quick & easy.

looking for a good python module for MS SQL server

P: n/a
Hi,
Does anyone know a good python mudule that works with MS SQL server?
Thanks,
Anat
Oct 31 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Anat napisa≥(a):
Does anyone know a good python mudule that works with MS SQL server?


Google will yield something, but I prefer adodbapi over specialized
modules. Works good with SQLServer using SSPI auth (others rather not).

--
Jarek Zgoda
http://jpa.berlios.de/
Oct 31 '05 #2

P: n/a
I've had good results with adodbapi as well.

Nov 1 '05 #3

P: n/a
Jarek Zgoda wrote:
Anat napisa≥(a):

Does anyone know a good python mudule that works with MS SQL server?

Google will yield something, but I prefer adodbapi over specialized
modules. Works good with SQLServer using SSPI auth (others rather not).

Though it does have problems with stored procedures.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 1 '05 #4

P: n/a
I successfully used mxODBC
(<http://www.egenix.com/files/python/mxODBC.html>)

Grig

Nov 1 '05 #5

P: n/a

Anat wrote:
Hi,
Does anyone know a good python mudule that works with MS SQL server?
Thanks,
Anat


I use the odbc module from pywin32. I believe that it is not 100%
DB-API 2.0 compliant, but it works fine for me. It has the advantage
that if you have installed pywin32 (which is advisable on MSW anyway)
you do not have to install anything else.

I tried adodbapi a few years ago, and it seemed slow in returning
results. I don't know if it has improved in the meantime.

There is one thing I have not figured out how to do with MS-SQL - I
would be interested if anyone has a solution. I use 'scrollable
cursors' a lot. DB-API does not seem to define any methods to
facilitate this, so I construct them and manage them myself with a
series of cur.execute(...) commands. PostgreSQL allows you to 'fetch'
multiple rows at a time. MS-SQL in its normal mode does not. This is
taken from the on-line help -

"Transact-SQL cursors are limited to fetching one row at a time. API
server cursors support fetching blocks of rows with each fetch. A
cursor that supports fetching multiple rows at a time is called a block
cursor."

It goes on to say that API's which support block cursors are OLE DB,
ODBC, ADO, and DB-Library, and that each one has its own syntax.

Do adodbapi, mxODBC, or any other modules allow you to do this?

Thanks

Frank

Nov 1 '05 #6

P: n/a
Steve Holden napisa≥(a):
Does anyone know a good python mudule that works with MS SQL server?


Google will yield something, but I prefer adodbapi over specialized
modules. Works good with SQLServer using SSPI auth (others rather not).

Though it does have problems with stored procedures.


Didn't discover any of these.

--
Jarek Zgoda
http://jpa.berlios.de/
Nov 1 '05 #7

P: n/a
Jarek Zgoda wrote:
Steve Holden napisa≥(a):

Does anyone know a good python mudule that works with MS SQL server?

Google will yield something, but I prefer adodbapi over specialized
modules. Works good with SQLServer using SSPI auth (others rather not).


Though it does have problems with stored procedures.

Didn't discover any of these.

Maybe things have changes since I last used adodbapi - can you actually
run stored procedures now?

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 1 '05 #8

P: n/a
Steve Holden napisa≥(a):
> Does anyone know a good python mudule that works with MS SQL server?

Google will yield something, but I prefer adodbapi over specialized
modules. Works good with SQLServer using SSPI auth (others rather not).

Though it does have problems with stored procedures.


Didn't discover any of these.

Maybe things have changes since I last used adodbapi - can you actually
run stored procedures now?


Things didn't change, as last update to adodbapi was long time ago... I
had no problems with stored procedures accessed using cursor's execute()
method (i.e. execute('exec sp_someproc, param')), but I never tried to
get any results, just call sp and commit or rollback.

--
Jarek Zgoda
http://jpa.berlios.de/
Nov 1 '05 #9

P: n/a
Jarek Zgoda wrote:
Steve Holden napisa≥(a):

>>Does anyone know a good python mudule that works with MS SQL server?
>
>Google will yield something, but I prefer adodbapi over specialized
>modules. Works good with SQLServer using SSPI auth (others rather not).

Though it does have problems with stored procedures.

Didn't discover any of these.


Maybe things have changes since I last used adodbapi - can you actually
run stored procedures now?

Things didn't change, as last update to adodbapi was long time ago... I
had no problems with stored procedures accessed using cursor's execute()
method (i.e. execute('exec sp_someproc, param')), but I never tried to
get any results, just call sp and commit or rollback.

Thanks. The situation does remain unchanged, then.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Nov 1 '05 #10

P: n/a
On 11/1/05, Jarek Zgoda <jz****@o2.usun.pl> wrote:
Things didn't change, as last update to adodbapi was long time ago... I
had no problems with stored procedures accessed using cursor's execute()
method (i.e. execute('exec sp_someproc, param')), but I never tried to
get any results, just call sp and commit or rollback.


Can the adodbapi module be used on a Linux/Mac client? If not, what's
the best choice for cross-platform connectivity to a Microsoft SQL
Server?

--

# p.d.
Nov 1 '05 #11

P: n/a

Peter Decker wrote:
On 11/1/05, Jarek Zgoda <jz****@o2.usun.pl> wrote:
Things didn't change, as last update to adodbapi was long time ago... I
had no problems with stored procedures accessed using cursor's execute()
method (i.e. execute('exec sp_someproc, param')), but I never tried to
get any results, just call sp and commit or rollback.


Can the adodbapi module be used on a Linux/Mac client? If not, what's
the best choice for cross-platform connectivity to a Microsoft SQL
Server?

--

# p.d.


I preserved this link from a discussion about a year ago, as I may well
need it one day. I have not actually tried any of the suggestions.

http://groups.google.co.za/group/com...6d5359c3c1b4bd

Frank

Nov 2 '05 #12

P: n/a
Peter Decker napisa≥(a):
Things didn't change, as last update to adodbapi was long time ago... I
had no problems with stored procedures accessed using cursor's execute()
method (i.e. execute('exec sp_someproc, param')), but I never tried to
get any results, just call sp and commit or rollback.


Can the adodbapi module be used on a Linux/Mac client? If not, what's
the best choice for cross-platform connectivity to a Microsoft SQL
Server?


Nope, adodbapi relies on COM/ActiveX subsystem, so it's not available
outside Windows.

PyMSSQL can use DB-LIB or FreeTDS, so it may have use also on
non-windows systems, see http://pymssql.sourceforge.net/ (didn't try
this one, though).

--
Jarek Zgoda
http://jpa.berlios.de/
Nov 2 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.