Question

I have a number from an Oracle database of 47306832975095894070.85314746810624532. When I bring it into SQL Server, it certainly doesn't show that many digits. It shows as 4.73068329750959E+19, and the field is defined as FLOAT.

I think that probably includes all the significant digits, but I'm being asked if the number can be stored exactly as Oracle had it. Is there a another data type that will store ALL the digits? Is there a way in SQL Server 2005 to display the number not in exponential, but show all the digits stored?

Was it helpful?

Solution

The equivalent of the NUMBER(p, s) Oracle datatype on Sql Server is the 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, a float represents a floating point number that is a whole different, approximate representation of a number. On Oracle, the equivalent would be BINARY_DOUBLE.

OTHER TIPS

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top