[Python-talk] accessing remote Microsoft SQL database from Linux using Python

Lloyd Kvam lkvam at venix.com
Mon Sep 25 07:58:56 EDT 2006

On Fri, 2006-09-22 at 19:16 -0400, Kent Johnson wrote:
> Python wrote:
> > I've been using the freetds library and Sybase python module to access a
> > remote Microsoft SQL server.  This appeared to work OK.
> > 
> > In actuality, the charvar fields that were more than 255 characters were
> > getting truncated.  I believe the problem is in freetds.  The
> > description of the cursor shows field lengths of 255 and I did not have
> > any cross check against the remote database.
> You could try pymssql, though it also runs on top of freetds so that may 
> not help.
In figuring this out, I used the freetds tools to determione that it was
the source of the 255 size.

> The state of Python access to SQL Server seems to be pretty poor AFAICT. 
> Seems like there is little interest in talking to MSSQL in the Python 
> community.

I would assume that the win32 modules provide easy access to the current
COM objects for dealing with databases.  Back when I was still working
on Windows specific stuff, I was amazed at how easy COM automation was
with Python.  So if you're already working in Windows, directly using
Microsoft's tools might argue against bothering with a cross-platform

> If Java / Jython is an option, I have had good success with Microsoft's 
> JDBC driver on Windows; it is also available for Linux.

Well, Java would have been on the table if I had not gotten this working
with Python.

> Kent
> _______________________________________________
> Python-talk mailing list
> Python-talk at dlslug.org
> http://dlslug.org/mailman/listinfo/python-talk
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:  603-653-8139
fax:    320-210-3409

More information about the Python-talk mailing list