Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

While executing a SPROC which transfers data from staging DB to Main DB am getting "Arithmetic overflow error converting decimal to data type numeric".

i understand that there is a issue with the scale and precision mismatch, though changing the Main DB scale and precision is not an option for me. Any suggestions please
Posted

You are right, this is a scale and precision issue.

Check what decimal scale and precision you have used for the field.
Here is an example
suppose, you declare a data type decimal(8,5)
that means out of 8 digits, 5 will be the decimal point. So, you can have max value 999.
If you have value 1000 or more, you will get the exception.

So, investigate the decimal datatype you have set and the values you are passing.

Hopefully, this solves your problem.

cheers
 
Share this answer
 
if there is an issue with precision then before in the stored proc, use rounding options to the number of precisions before transferring the data. But still it will result in some data loss. The ideal solution will be still changing the scale and precision in datatype
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900