BigInt in SQL Server
Libin Qi <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
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!