Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL-server, largest value for numeric(16, 8)?

Just got badly bitten by MS SQL when tried to save a large value 11545545645.00 into a column with type numeric(16, 8).

Is there a way to figure out the max value such a numeric column can have based on its precision and scale?

like image 297
shrini1000 Avatar asked Jun 15 '13 17:06

shrini1000


1 Answers

The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. decimal and numeric (Transact-SQL)

So in your case numeric(16, 8) you have 8 (16 - 8) digits left before the decimal point

like image 119
bummi Avatar answered Dec 10 '22 08:12

bummi