Skip to Content.
Sympa Menu

freetds - Re: Can't read long varchars or long text, please help

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Michael Horowitz" <michael.horowitz AT storagenetworks.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Can't read long varchars or long text, please help
  • Date: Mon, 14 Jan 2002 14:34:57 -0500


The following is in the FreeTDS FAQ:

7.1 My text data are being truncated or are causing my client to break.
The text data type is different from char and varchar types. The maximum
data length of a text> column is governed by the @@textsize variable on
the server. Microsoft claims in their documentation to use a default
textsize of 4000 characters, but in fact their implementation is
inconsistent. Sometimes text columns are returned with a size of 2 GB!

The best solution is to make sure you set @@textsize to a reasonable value
when establishing a connection.

This is in the README that comes with the source:

Support for TDS 7.0 (the version used by MS SQL Server 7.0) is now
included. It is not as mature as the other protocol versions, but is
required to access large (more than 255 character) char/varchar
fields.

I hope this helps.

--Mike

> I submitted the message below about long varchars, but got no response and
> didn't worry about it since I was able to change the varchar column to a
> text type. Now I find that I can only read the first 4095 bytes of the
> text column. This happens in both 4.2 and 7.0 mode. I haven't found any
> reference to this problem and I'm wondering whether it's something I've
> done locally or whether it's a bug of 5.3.
>
> Your help is most heartily welcome,
>
> Chris Waidele
>
> >I setup freetds 5.1, with php4 and linux 7.1 (connecting to mssql 7) on a
> >test machine where I was able to get long varchars (over 255 bytes) to be
> >read properly by configuring interfaces to use tds4.2, but there was a
> >long query (using embedded selects)that would give me incorrect values
> >unless I ran it under tds4.2.
>
> >So, I installed 5.3 on another machine and now I'm able to get the right
> >result on the query but I can't get long varchars to work under 4.2 or
> >7.0.
>
> >I know I can change the varchar to text, but I'd like to know if there's
> >another solution or if I've done something wrong.




Archive powered by MHonArc 2.6.24.

Top of Page