Skip to content

sqlserver 2008 varchar(max) returned as binary via EasySoft odbc driver #35

@MichaelScott

Description

@MichaelScott

Swapping the FreeTDS odbc driver for the EasySoft driver on ubuntu 9.04 with RoR and sqlserver 2008 caused fields typed as varchar(max) to be interpreted as binary.

EasySoft support response:
The problem is that your application is taking the large size of the
field and assuming it is a BLOB type. FreeTDS is working because they
do not support VARCHAR(MAX) to its limit - they only return a subset
of the data. In your ODBC data source try adding / amending :-
VarMaxAsLong = Yes
If that does not work try :-
DisguiseLong = Yes
LimitLong = size - Where size is a byte value of the maximum size of
the field.

Setting all three attributes as suggested in /etc/odbc.ini file made
the problem did go away. The varchar(max) data displays correctly as
text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions