Re: VARCHAR values > 8000 bytes truncated (db-lib)
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <CAHt6W4c1jkZG8U-4M2AYhs1_kZBxPEPp_dbA8ke1qCTHqMnxGQ@mail.gmail.com> |
Il 11/Dic/2015 13:12, "Joshua Lang" <[email protected]> ha scritto: > > 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 > Hi, Varchar(max) is more similar to text than to normal varchar so type is not promoted. I don't remember if text is promoted to varchar(max) under dblib. Frediano