If you read all of that thread there was a fix for it.

http://lists.ibiblio.org/pipermail/freetds/2011q2/026944.html

> As others have mentioned, the bug appears to be caused in > src/tds/query.c and can be largely fixed with this patch: > > --- freetds-0.91RC2-orig/src/tds/query.c 2011-03-30 > +++ freetds-0.91RC2-patch_truncation/src/tds/query.c 2011-05-05 > @@ -799,7 +799,7 @@ > if (tds_get_column_declaration(tds, > params->columns[i], \ declaration + strlen(declaration)) == TDS_FAIL +) > goto Cleanup; > } else { > - strcat(declaration, "varchar(80)"); > + strcat(declaration, "varchar(4000)"); > } > > /* convert it to ucs2 and append */ > > However, I'm not sure that every server accepts varchar(4000) as a > column type, and some may allow even larger varchars (so that the > fixed code is still buggy if the string is longer than 4000 chars). > I'd be interested in your thoughts on the right way to fix it. Thanks for the patch. It will help many DBD::Sybase users. I applied it, along with some minor typographical changes, to CVS HEAD and to th +e 0.91 release branch. This is a perfect example of fixing what matters. I personally don't use parameterized queries and await a real fix ;-) which will involve passing a parameter descriptor to ct-lib. Meanwhile, your one-liner solves an immediate problem for any reasonably modern Microsoft server.
http://freetds.cvs.sourceforge.net/viewvc/freetds/freetds/src/tds/query.c?view=markup

In reply to Re^4: dbi and sqlserver truncating text by Anonymous Monk
in thread dbi and sqlserver truncating text by fionbarr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.