views:

38

answers:

2

I face one problem, one column is i have taken as numeric(38,0)

Data stored in this column is going out of range, means it is reach it's storage limitation. i have tried with also bigint , but facing same problem.i can not take it as varchar because i have to use in another calculation so at that time i must need to convert it from varchar to bigint ot numeric(38,0).

So, is there any solution to store high range value.

A: 

Can you be more specific? What numbers are you storing that require more than 38 digits, but that you expect to perform math against?

Aaron Bertrand
Suppose one column(numeric (38,0)) has stored value which is last limit of numeric. Now i want to so calculation for multiplication with 19.55 and result value should store in same column, then it will give error for Overflow.So what will be alternative solution or how can avoid this issue.
Paresh
Can you provide an example of a number where 38 digits are significant, and that you need to multiple by another decimal? I understand you are saying you have a DECIMAL(38,0) that you need to multiply by 19.55. But what does this number really represent? Can you store it as DECIMAL(36,0) and then leave the last two digits as statistically irrelevant, and just add the decimal places at display time? Can you use FLOAT(53) as otherwise suggested?
Aaron Bertrand
+1  A: 

A float can handle really big numbers. The most precise float is a float(53) with 15 digit precision.

Andomar
float(38) has the same precision as float(53). float(1..24) is 7 digit precision on 4 bytes storage, float (25..53) has 15 digits precision on 8 bytes storage. http://msdn.microsoft.com/en-us/library/ms173773.aspx
Remus Rusanu