I want to convert my float field into a decimal field; I want a precision of 11,2 in my decimal field, but when I tried to change the type of my field(example: Amount) I get an error: "Arithmetic overflow error converting float to data type numeric. The statement has been terminated." My field is decimal(11,2) at the table, and my max and min values are: 1,603,837,393.70 < -- > -1,688,000,000.00(amount).
I created a temporary table to take out the data and changed the structure of my fields and that worked o.k. but now I need to put the data back (temporary table is still having the original float fields), and I just simply cannot make it insert values with a insert select statement.
Since my values don't exceed the range of my type I wonder why is not even possible to cast on a select statement like this:
select Id,AccountId, cast(Amount as decimal(12,2)) as Amount,
cast(AmountB as decimal(12,2)) as AmountB
FROM myTable
I cannot identify the reason to not convert my field.