Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 SSIS Truncates Decimal Instead of Rounding

Author  Topic 

wackoyacky
Starting Member

25 Posts

Posted - 2012-07-10 : 08:54:04
Hi,

Is there anyway I can make SSIS read numeric fields by rounding off based from the set precision of the field?

I have a flat file which has a numeric field that is in this format ##,####.######. But the table destination only has a (18,2) precision.

So in my flat file source manager I set the property of this column to DT_NUMERIC with (18,2) precision. I was expecting that by doing this, it would automatically round off the field as it reads from the file, but unfortunately it TRUNCATES instead.

I know I can just read the field with larger precision then use ROUND function in a Derive Column or Transformation, but I had 80 feeds which has a number of numeric fields, so this additional work. This is only my last option if everything fails

Any idea how can I change this behaviour of the flat file manager?

Thanks
Enzo

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2012-07-10 : 09:08:40
the ssis package is an xml file internally.

You may be able to:
1) TAKE A COPY!!!!!!
2) Try doing a find replace on the xml file to model the behaviour you want.

but SSIS is very picky about its xml file -- it'll barf it out if you get things wrong.....

Transact Charlie

Msg 3903.. The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
Go to Top of Page
   

- Advertisement -