sql-serverssisetldata-conversionssis-2012

data conversion issue while executing a ssis package


Executing my package and i am seeing below error. EMP ID from source (Flat file) is DT_STR(50) and loading it into table:

EMP_ID int not null column

Using data conversion task i am converting it in to four byte signed integer

But Job is failing.

Description: Data conversion failed while converting column "EMP ID" (105) to column "EMP ID" (25). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.". End Error Error: 2019-09-16 11:37:28.53
Code: 0xC0209029 Source: Data Flow Task 1 Data Conversion 0 - 0 [2] Description: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Data Conversion .Outputs[Data Conversion Output].Columns[EMP ID]" failed because error code 0xC020907F occurred, and the error row disposition on "Data Conversion 0 - 0.Outputs[Data Conversion Output].Columns[EMP ID]" 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. End Error Error: 2019-09-16 11:37:28.53 Code: 0xC0047022 Source: Data Flow Task SSIS.Pipeline Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Data Conversion (2) failed with error code 0xC0209029 while processing input "Data Conversion Input" (3). 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. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 11:37:27 AM Finished: 11:37:28 AM Elapsed: 0.797 seconds. The package execution failed. The step failed.


Solution

  • The main error is:

    The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data

    It looks like that the source column contains values that cannot be converted to integer, you can configure the error output to redirect bad rows to a flat file destination in order to check the values that are causing this error.

    enter image description here

    enter image description here

    enter image description here