[freetds] "Data conversion resulted in overflow" with float constants

David Chang dchang at fsautomation.com
Wed Jun 12 20:04:01 EDT 2013


Ariel,

In your freetds.conf file, did you set the tds version to 8.0?  For example:

[DBMS1]
         host = 192.168.1.1
         port = 1433
         tds version = 8.0

I tried your statements using my own DB-Library program (not fisql) and 
they all worked fine.  I did this against SQL Server 2012, SQL Server 
2008 R2, and SQL Server 2005.  I don't have a copy of SQL Server 2008.

DC

On 6/12/2013 3:26 PM, arielCo wrote:
> I'm getting these errors with FreeTDS 1.91 against SQL Server 2008
> which I can't make sense of:
>
> $ ~/freetds/bin/fisql -S prueba -U ariel
> Password:
>
> 1>> select 1.1 foo
> 2>> go
> foo
> ---
> 1.1
> (1 rows affected)
>
> 1>> select 1.11 foo
> 2>> go
> foo
> ---
> 1.11
> (1 rows affected)
>
> 1>> select 1.111 foo
> 2>> go
> foo
> ---
> DB-LIBRARY error:
>          Data conversion resulted in overflow
> Operating-system error:
>          Error 0
> ---
> (1 rows affected)
>
> 1>> select 1.0
> 2>> go
>
> DB-LIBRARY error:
>          Data conversion resulted in overflow
> Operating-system error:
>          Error 0
> (1 rows affected)
>
> 1>> select 99.0 foo
> 2>> go
> foo
> ---
> 99.0
> (1 rows affected)
>
> 1>> select 100.0 foo
> 2>> go
> foo
> ---
> DB-LIBRARY error:
>          Data conversion resulted in overflow
> Operating-system error:
>          Error 0
> ---
>
>
> Apparently I can't write a literal float with more than four
> characters. Furthermore, I can't write any decimals without a column
> alias (fourth query above).
>
> Since I'm a complete MS SQL newbie, I tried the example provided in
> the Transact-SQL documentation and it fails too:
>
> 1>> DECLARE @myval decimal (5, 2)
> 2>> SET @myval = 193.57
> 3>> SELECT CAST(CAST(@myval AS varbinary(20)) AS decimal(10,5))
> 4>> go
> (1 rows affected)
>
> DB-LIBRARY error:
>          Data conversion resulted in overflow
> Operating-system error:
>          Error 0
>
>
> Am I doing something terribly wrong? These work in SQL Server Management Studio.
>
> Thanks in advance,
> ariel cornejo
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds



More information about the FreeTDS mailing list