Skip to Content.
Sympa Menu

freetds - [freetds] VARCHAR values > 8000 bytes truncated (db-lib)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Joshua Lang <joshua.h.lang AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] VARCHAR values > 8000 bytes truncated (db-lib)
  • Date: Thu, 10 Dec 2015 11:02:49 -0800

When trying to pass stored procedure VARCHAR(MAX) parameters (using
SYBVARCHAR for the parameter type), the value is truncated at 8000. This is
due to the `tds_fix_column_size` method limiting the value to 8000 because
the `column_varint_size` of the column == 2.

Based on the comment in `tds_fix_column_size` (src/tds/query.c), it seems
as if this is unexpected:

/* note that varchar(max)/varbinary(max) have a varint of 8 */

The comment above indicates that this should be supported. Am I missing
something or using the db-lib API incorrectly? My code is working fine
otherwise.




freetds: 0.95.73
OS: Ubuntu 14.04
DB: MS SQL Server 2008 SP3
TDS: 7.3

Thanks

-j




Archive powered by MHonArc 2.6.24.

Top of Page