Question : TSQL- Arithmetic overflow error converting float to data type numeric.

I am migrating data from one table to a new table. The old table uses FLOAT, and in the new table I am using DECIMAL as the field attribute.

I am using the following statement which worked fine:
CAST(OLD_COLUMN_NAME as DECIMAL(9,2) AS 'NEW_COLUMN_NAME'

that works like a charm until I hit the bump in the road. The old data is defined as float,null, the new field is defined as decimal(5,5).

The input data from the old field is varied and looks like this: 5, 0.5, 0.5, 0.75, 2, and so forth.

The error I am receiving is Msg 8115, Level 16, State 6, Line 8  Arithmetic overflow error converting float to data type numeric.The statement has been terminated.

The code is against a SQL SERVER 2005 database using SQL SERVER 2008. Not sure this matters, but thought I would include this information.

Could someone shed some light on how to address this data conversion issue? Thank you!

Answer : TSQL- Arithmetic overflow error converting float to data type numeric.

Another suggestion:

- Are both the usernames and passwords the same? In advanced sharing, have you typed in Everyone at the top and then clicked Add?
Random Solutions  
  •  VB.NET 2008 Get resource file as IO.Stream
  •  Not caching pages 21318 through 21319 because of write on page 21319 on write.
  •  Issues installing Crystal Report Viewer with cxlibw-1-6.dll Using Package and deployment VB6 and Crystal Version 10
  •  editing CSV file in VB. Visual Studio 2010 used.
  •  How to forcefully apply the Group policy to all the computers in  SBS 2008 environment ?
  •  How to convert an XML input field for a C# console application to a deciamal value for a fixed length field with leading zeros?
  •  Change this Logon script to quer a txt file with machine names and do the same task.
  •  How do I automatically move to the next cell when I enter a single-digit number?
  •  Calling PHP Function from Javascript - Ext-JS
  •  Access 2003: form with a subform - question about placing a vertical scroll bar... on main form....
  •  
    programming4us programming4us