Tuesday, September 18, 2012

Transact SQL Arithmetic overflow error

Getting
Arithmetic overflow error converting numeric to data type numeric.
when trying to insert into your MS SQL (Transact SQL) table?

Most probably this is caused by the datatype of your field. If the type is for example numeric(18,18) this does not mean that you can have 18 digits before the decimal point and 18 after. It actually means that you can have a total of 18 digits (specified by the first value) and 18 digits after the decimal point.

As you might realize this means you can't have any values larger or equal than 1.0 in your field.

So, if that's what your're trying to do, change the field type to for example numeric(18,5) which will give you 5 digits in front of the decimal point and 13 after.

Source: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=35602

No comments:

Post a Comment