[python-win32] unable to read mssql varchar(max)

John john at saponara.net
Thu May 27 17:56:03 CEST 2010


Hi,

When a ms sql server database column was changed to varchar(max), my 
python code became unable to read that column.  no matter the actual 
value, python sees it as '\x00'.  I use sql server 2008, python 2.4, and 
pywin32-214.  it had worked when the column was a fixed size varchar, eg 
varchar(1000).  essentially my code is:

connectionString=r"driver={SQL Server Native Client 
10.0};server=...;uid=...;pwd=...;database=..."
connection=odbc.odbc(connectionString)
cursor=connection.cursor
cursor.execute("select ...")
cursor.fetchall()

Could anyone suggest what the problem might be?

Thanks,
John




More information about the python-win32 mailing list