[egenix-users] SQL Server 2000, mxODBC version 2.0.4 for Python 1.5.2 and' ntext data type

M.-A. Lemburg mal at lemburg.com
Sat Aug 31 23:41:55 CEST 2002

Tommi Auvinen wrote:
> Is it a known feature (or even a bug ;) that if data type is ‘ntext’ 
> then something goes wrong around every 1024 characters? There seems to 
> be an extra 000 (null) character. The data is fetched OK if I change the 
> data type in DB to ‘text’ or change the query to something like “… 
> CONVERT(text, Data) AS Data”.

ntext is managed as Unicode in SQL Server, but mxODBC requests
these columns as strings (unless you set cursor.stringformat)
in chunks of 1024 bytes. Could be that the ODBC driver messes
up the inplace conversion of Unicode to 8-bit strings when using
this kind of chunked retrieval.

Have you tried this with the latest ODBC driver versions available
for SQL Server ?

If the problem persists, we'll have to look into adding a
work-around to mxODBC.

Marc-Andre Lemburg
CEO eGenix.com Software GmbH
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/

More information about the egenix-users mailing list