looking for a good python module for MS SQL server

J

Jarek Zgoda

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).
 
S

Steve Holden

Jarek said:
Anat napisa³(a):




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
 
F

Frank Millman

Anat said:
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
 
S

Steve Holden

Jarek said:
Steve Holden napisa³(a):




Didn't discover any of these.
Maybe things have changes since I last used adodbapi - can you actually
run stored procedures now?

regards
Steve
 
J

Jarek Zgoda

Steve Holden napisa³(a):
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.
 
S

Steve Holden

Jarek said:
Steve Holden 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.
Thanks. The situation does remain unchanged, then.

regards
Steve
 
P

Peter Decker

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?
 
J

Jarek Zgoda

Peter Decker napisa³(a):
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top