Page 1 of 1

rounding issue while loading in to sql server

Posted: Wed Oct 15, 2008 12:40 am
by snt_ds
Hi,

while loading the data in to sql server I am facing the below issue:


Input dataset values are 3.4455, 55.667, 333.44445

In sql server database it is loading like : 3.4400012, 55.6670122, 333.4444499999

But I need the o/p like: 3.44, 55.66,333.44 i.e i need the o/p precision 2 decimals.

And the datatype is float in the database (sql server) .

In Transformer stage i have used the decimal conversion option by giving scale 2 ,but for some of the values is loading properly, not all the records

Please advice me the handling process for above issue and any other alternative process .

Thanks in Advance

Posted: Wed Oct 15, 2008 1:29 am
by ArndW
What is your source data type, are you doing an implicit conversion to float in the transform stage?

Posted: Wed Oct 15, 2008 7:55 am
by snt_ds
ArndW wrote:What is your source data type, are you doing an implicit conversion to float in the transform stage?
Source datatype is Decimal and by using decode function changed to varchar and done decimal converion in transform stage

Posted: Wed Oct 15, 2008 9:20 am
by ArndW
Would it be possible to remove the character conversion from the process and stick with numeric values? This would make it simpler (and faster).

Posted: Wed Oct 15, 2008 3:14 pm
by ray.wurlod
Data types float and dfloat can not be stored accurately in digital computers. Stick with Decimal or Numeric as the data type.