Re: Column types reported from SQL Server 1008

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Fri, 18 Nov 2011 12:58:14 +0300
Steve Teale <[email protected]> wrote:
> I have 2 columns that the SMS shows as bigint, a time(7) column, and a
> date column among others.
...
> The type for the bigint columns comes back as 8 (SQL_DOUBLE), and
the
> type name correspondingly as 'float'. The time and date columns are
> reported as 12 (SQL_VARCHAR) and 'varchar'.
...
> My freetds.conf file has the protocol version as 8.0.
> 
> What am I missing?

You're missing support for TDS version 7.3.  

The TDS client you're using cannot decode the binary format of bigint,
date, and time types.  These types first appeared on SQL Server 2008,
which brought us TDS 7.3.   

The client announces the TDS version it uses in the login packet.  The
server knows which datatypes are defined for each protocol version.
It converts datatypes not defined in a given version to something
defined i.e., something the client will recognize and be able to
decode.  

The version of FreeTDS you're using logs in as TDS 7.2, for which
BIGINT is undefined.  The server returns it as FLOAT.  IEEE 754 defined
double-precision floating point as 52 bits of precision, which, while
not 64 bits, is certainly better than the 32 bits in an INT.  After
2^52 you get approximations.  Perhaps before then you'll get TDS 7.3.  

Work toward support for TDS 7.3 in FreeTDS is ongoing and has been
discussed before on this list in the last few months.  No promises
when it will be ready, not even guesses. There's always room for more
hands.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.