Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Help with runtime error

Author  Topic 

JoeGonz
Starting Member

10 Posts

Posted - 2003-10-03 : 18:58:36
Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated.

Can anyone tell me what could be causing the above error message? Thanks.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-10-03 : 19:15:08
The value being converted cannot fit within the capacity of the numeric data type you've declared. For instance:

DECLARE @num numeric(3,2) --format a 3 digit number with 2 decimal places
SET @num=10.1 --error, 10 exceeds the max value that can be stored

Make sure you are declaring both the precision and scale for your numeric column/variable. You cannot do this:

DECLARE @num numeric
--or
DECLARE @num numeric(10)
Go to Top of Page

JoeGonz
Starting Member

10 Posts

Posted - 2003-10-04 : 14:50:11
Thanks for the help.
Go to Top of Page
   

- Advertisement -