Quantcast
Viewing all articles
Browse latest Browse all 3587

Re: Issue with DB Space calculation

Hi,

 

decimal(4,2) means 4 digits; 2 of them after the decimal point and 2 before. Your value 116.2109375000000000 has 3 digits before the decimal point and so you receive the error message. In order to correct this, you have to increase the number of digits before the decimal point to 3. So decimal (5,2) will work: all in all 5 digits and 2 of them after the decimal point.

 

1> select convert(decimal(4,2), 116.2109375000000000)

2> go

Msg 247, Level 16, State 1:

Server 'XXX', Line 1:

Arithmetic overflow during explicit conversion of NUMERIC value '116.2109375000000000' to a DECIMAL field .

 

1> select convert(decimal(5,2), 116.2109375000000000)

2> go

 

 

--------

   116.21

 

 

(1 row affected)

 

 

Best regards,

Juergen


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>