Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSIS import from CSV is truncating the Decimal 1

Status
Not open for further replies.

appelq

IS-IT--Management
Dec 28, 2004
72
US
I'm using Visual Studio Pro 2017 v15.9.11 to create a basic SSIS Package to read data from a CSV File.

In my SQL Table (I am importing INTO) I have a column - [InvAmt] as decimal(19,2)
In my Flat File Connection Manager, (for th eCSV Import file) the column is set :
DataPrecision = 0
DataScale = 2
DataType = decimal [DT_DECIMAL]

A value of 250.72 gets imported as 272.00 truncating the decimal value.

I tried changing the column setting to
DataPrecision = 19
DataScale = 2
DataType = numeric [DT_NUMERIC]

and I get the same result.

Any ideas?

Thanks in Advance.

Chuck
 
somewhere along the pipe it is most likely changing from decimal (x,2) to int or decimal (x,0)

you can check that by going to the mapping tab on the dataflow and hoover over the 2 values to see how each column (both db and file) are defined.

and check also on advanced editor properties of the source within the data flow, input and output properties and look at both internal and external colunmns.

this assumes also that you do not have any task between source and destination on your dataflow.

note that sometimes when changing properties on a file connection these are not fully propagated on the dataflows so it is better to remove the source on the data flow and add it again - as well as the destination.

to ensure that it the values are going well up to the destination component add a data viewer between source and destination and ensure that the value is correct at that point - if it is correct and if the destination has indeed the required decimals see if you by any change have a trigger on the table that may be changing the value on inserts.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
I believe you were right, that the property change, did not propagate.
I double clicked on the Data Flow Path between my Flat File Source and the OLE DB Destination.
Then Selected "Data Viewer" and enabled it.
I then ran the Package and it it worked fine.
Then the Disabled the data viewer, re-ran again and it is still importing OK.

Thanks for your help.
Chuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top