Skip to Content.
Sympa Menu

freetds - Re: [freetds] error with freetds, python and Sql Server 2003

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: erik.myllymaki AT aviawest.com, FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] error with freetds, python and Sql Server 2003
  • Date: Tue, 4 Apr 2006 22:07:41 -0400

Erik Myllymaki wrote:
> In particular, it i the size of the python strings to be inserted that
> causes the errors:
>
> inserting string <= 255 characters into a MSSQL VARBINARY(8000) field
> works
>
> inserting string of length 256 characters into a MSSQL VARBINARY(8000)
> errors with:
> mx.ODBC.Error.Warning: ('22001', 8152, '[unixODBC][FreeTDS][SQL
> Server]String
> or binary data would be truncated.', 6083)

It's a little hard for us to tell what's happening, because it's not clear
what Python is asking of FreeTDS. I'd like to know what datatype Python
is presenting your data as, i.e. how it's binding its data. It looks like
it's asking for a binary binding. That would explain why you get
"varbinary is incompatible with text".

First of all, are you using TDS 7.0 or 8.0? You should be. The top of
your TDSDUMP log will tell you.

Second, I bet you'll find that 'data would be truncated' message in your
TDSDUMP log, too. It would be interesting to see that line and the 200 or
so lines around it.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page