Data conversion error

  • I have problem with convertion of Varchar data to Real , the below query works fine in one server and another server throws the error 'Error converting data type varchar to real'

    Query : SELECT CONVERT(real,'689.99')

    Please help.. Thanks

  • Try using FLOAT

    SELECT CONVERT(FLOAT,'689.99')

  • float gives the same error..

  • I did not get any error see below: check if you installed fresh sql server  service pack

    SELECT CONVERT(real,'689.99')

    ---result---------------------

    689.98999

    (1 row(s) affected)

    ---

  • try SELECT CONVERT(real,'689,99')

    and see if that works.

  • Check for differences between the server settings inc. @@MAX_PRECISION and service pack level.

    Also any patches which may have been applied to SQL Server.

  • Nothing of the above worked , but weekly reboot of server this morning cured the issue... Puzzling!

  • That would imply a server setting or session setting was changed.

    This was then reset to default on reboot.

    Not sure what it might be though.

  • I think you are right, we got lot of guys playing with servers here...

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply