Skip to Content.
Sympa Menu

freetds - [freetds] BigInt in SQL Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Libin Qi <libinsub AT yahoo.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] BigInt in SQL Server
  • Date: Mon, 26 Jul 2010 11:07:25 -0700 (PDT)

Hi! All: I am using CT Library comes with freeTDS to get some data from a
Microsoft SQL Server. I noticed if the field is defined as BigInt(which is a
64
bit int) in SQL Server, the CT Library somehow translates it into a
CS_FLOAT_TYPE and ended up losing some precision. I wonder if this is a known
bug?

e.g.
In SQL Server, do this:
create table test1(AA bigint, BB int, CC smallint, DD tinyint, EE
float)
;
insert into test1 values(1234567891234567899, 12345678,123,12, 13.245678) ;

When I retrieve that record using CT Library, it becomes:
1234567891234567936,12345678,123,12,13.245678

You can see the first coumn is different from database. but If I do the
select
command directly in SQL Server console, I got the original number, which
indicates the server does not lose the precision.

Thanks!






  • [freetds] BigInt in SQL Server, Libin Qi, 07/26/2010

Archive powered by MHonArc 2.6.24.

Top of Page