Showing results for 
Search instead for 
Did you mean: 

Migrating Oracle Number to SQL Server Numeric

New Contributor III

I have data I need to move from Oracle to SQL Server. In Oracle the data type is just “NUMBER”. No precision or scale specified.

I know from analysis that these values are in some of the rows for one of the columns.

SQL Server has a Numeric data type. Max precision is 38. I cannot define a numeric data type that will work with these values. If I did something like Numeric(12,26), it won’t hold the first value. If I did something like Numeric(38,38), it won’t hold the second value.

I want to just lop off some of the decimals so that I never exceed 26 numbers to the right of the decimal.

I have been trying to do this in the mapper and am stuck.

The toPrecision function doesn’t do what I want.

If X = 239.41789473684210526315789473684210526
x.toPrecision(26) returns 239.41789473684210065584921

It starts changing everything instead of just rounding to 26 decimal points.

Any ideas on what I can do here?


Former Employee

Hello, did you try object.toFixed() ?