Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Converting to Float in ssis Expand / Collapse
Author
Message
Posted Tuesday, April 2, 2013 3:38 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 16, 2013 9:24 AM
Points: 195, Visits: 39
I'm exporting Flat File to DB Table.
In Flat File I have numeric column with some values has empty space.
In Derived column I'm using " [Column 188] == " " ? "0" : [Column 188] " to make empty space as 0.
then In data conversion I'm converting it to float b'coz destination column is Float.

But I'm getting as errors as follows


[Data Conversion [3495]] Error: Data conversion failed while converting column "Derived Column 2" (6895) to column "Copy of Derived Column 2" (6901). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".


[Data Conversion [3495]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "Copy of Derived Column 2" (6901)" failed because error code 0xC020907F occurred, and the error row disposition on "output column "Copy of Derived Column 2" (6901)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.


[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Data Conversion" (3495) failed with error code 0xC0209029 while processing input "Data Conversion Input" (3496). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
Post #1437774
Posted Thursday, April 4, 2013 2:19 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, August 6, 2014 11:18 AM
Points: 80, Visits: 348
I am intermediate SSIS programmer, but it looks like a data conversion issue to me.

If column 188 is a numeric, you have strings mixed into the equation.


[Column 188] == " " ? "0" : [Column 188]



My advice is to compare apples to apples.

The derived column conversion below converts every thing to a varchar(10).


(DT_WSTR, 10)[Column 188] == (DT_WSTR, 10)"" ? (DT_WSTR, 10)"0" : (DT_WSTR, 10)[Column 188]


Change according to your target field, which I am assuming is a varchar(10).


John Miner
Crafty DBA
www.craftydba.com
Post #1439010
Posted Friday, April 5, 2013 12:58 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, September 16, 2013 9:24 AM
Points: 195, Visits: 39
Thanks.

But Len[column 1]>0?[column 1]:0
This will clear the error converting to Float which has Empty space
Post #1439114
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse