How many digits can be stored for a number in SQL Server 2005?

I have a number from Oracle database 47306832975095894070.85314746810624532. When I list it in SQL Server, it certainly doesn't show many numbers. It shows up as 4.73068329750959E + 19 and the field is defined as FLOAT.

I think it probably includes all significant digits, but I am asked if a number can be stored exactly like Oracle does. Is there any other data type that will store ALL digits? Is there a way in SQL Server 2005 to display a number non-exponential, but display all stored numbers?

0


source to share


3 answers


Equivalent to NUMBER (p, s) Oracle datatype on Sql Server is numeric (p, s) datatype. Note that the default values ​​for p (precision) and s (scale) are not the same on both platforms.



On Sql server, float is a floating point number, which is a completely different, approximate representation . In Oracle, the equivalent would be BINARY_DOUBLE .

+2


source


Use decimal data type. decimal (p, s) - p is the precision value, s is the scale value.



+3


source


instead of float, use Decimal (38,17). This should allow you to store the number with the same precision as in Oracle.

+3


source







All Articles