How to determine faulty row/column in SSIS transformation - sql-server

I'm running a DTSX package to move data from SQL to Postgres using the PGOLEDB Native Postgres driver and I'm receiving an error (below). How do I read this error and determine what row/column is causing the issue?
I'm receiving the following error (PGNP-SE-1.4.3076):
OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071636471,0x,SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "PostgreSQL Native Provider" Hresult: 0x80004005 Description: "ERROR: invalid byte sequence for encoding "UTF8": 0x96
CONTEXT: COPY TransHist, line 390
".
OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071636471,0x,SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "PostgreSQL Native Provider" Hresult: 0x80004005 Description: "ERROR: invalid byte sequence for encoding "UTF8": 0x96
CONTEXT: COPY TransHist, line 390
".
OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071607767,0x,SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (95)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (95)" 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.
OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071607767,0x,SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (95)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (95)" 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.
OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 40 - TransHist" (82) failed with error code 0xC0209029 while processing input "Destination Input" (95). 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.
OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 40 - TransHist" (82) failed with error code 0xC0209029 while processing input "Destination Input" (95). 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.
UPDATE:
I think the encoding error is a red-herring. When I run this it fails on row 1000 (successfully writes 999 rows). If I change the source to a view that limits the results to less than 1000 rows (say 500) it succeeds (but obviously not all the data is moved). If I change the destinations connection string to BULK_INSERT=500...it will fail on row 500 and if I change the view to less than 500 it succeeds.
UPDATE 2:
Setting BULK_INSERT to 0 fixes the issue...I'm sure that has negative effects on performance though.

A quick way to determine which row(s) are responsible for the error is to error behavior from the default of "fail component" to "redirect rows" and then pipe the error output to a flat file.
For your particular error, the key message is:
"ERROR: invalid byte sequence for encoding "UTF8": 0x96
Google'ing this string brings back a few hits indicating a string encoding issue. Here's a link from the google-results back to stackoverflow.
You could try using a data conversion task to specify the correct encoding in the data flow task or you could make adjustments on the destination system (but I'm not really familiar with Postgres so can't help you there)

Related

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.
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.

SSIS Derived Column (Find String)

I am extracting pattern from the 'Notes' column, I am looking for an alpha numeric word (MXPC123456) from the notes and I want to store the output in a new column. So for that I am using a Derived Column and FindString() function.
I am getting error when I run this code using the following expression in Drived Column inside my SSIS package:
(DT_WSTR,255)SUBSTRING(TEXT_LINE1,FINDSTRING(TEXT_LINE1,"MXPC",1),10).
Don't know what I am doing wrong.
Error: 0xC0049067 at Get DC Coms Data, Derived Column [67]: An error occurred while evaluating the function.
Error: 0xC0209029 at Get DC Coms Data, Derived Column [67]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "Derived Column" (67)" failed because error code 0xC0049067 occurred, and the error row disposition on "output column "CKT_MX" (91)" 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.
Error: 0xC0047022 at Get DC Coms Data, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Derived Column" (67) failed with error code 0xC0209029 while processing input "Derived Column Input" (68). 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.
Could you please help?
Regards
Prab
There are 2 things that may cause this error:
TEXT_LINE1 doesn't contains "MXPC" string , so FINDSTRING(TEXT_LINE1,"MXPC",1) will return 0 and the SUBSTRING function will throw an exception
TEXT_LINE1 contains "MXPC" string but there is no 10 characters after the FINDSTRING returned value
TEXT_LINE1 IS NULL
so you can add some validation to this expression
ISNULL([TEXT_LINE1]) == TRUE ? "" : (FINDSTRING([TEXT_LINE1],"MXPC",1) == 0 ? "" :
(LEN([TEXT_LINE1]) >= FINDSTRING([TEXT_LINE1],"MXPC",1) + 9 ? SUBSTRING([TEXT_LINE1],FINDSTRING([TEXT_LINE1],"MXPC",1),10) : ""))

SSIS VS2012 convert flat file Text to Boolean

I am trying to take data from a CSV and import the records into my database. I have an SSIS package that reads in the flat file, passes it through a data conversion and then sends it to the database.
The problem I am having is the field that has "True" "False" or blank needs to be converted to a Boolean. This package worked in the past but we have upgraded from SQL 2008 to SQL 2014 and taken the package from VS2008 to VS2012.
Error:
Error: 2015-09-15 23:00:03.23
Code: 0xC02020C5
Source: Data Flow Task 1 Data Conversion 0 - 0 [2]
Description: Data conversion failed while converting column "aginactive"
(192) to column "aginactive" (62). 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: 2015-09-15 23:00:03.23
Code: 0xC0209029
Source: Data Flow Task 1 Data Conversion 0 - 0 [2]
Description: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The
"Data Conversion 0 - 0.Outputs[Data Conversion Output].
Columns[aginactive]" failed because error code 0xC020907F
occurred, and the error row disposition on "Data Conversion
0 - 0.Outputs[Data Conversion Output].Columns[aginactive]"
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: 2015-09-15 23:00:03.23
Code: 0xC0047022
Source: Data Flow Task 1 SSIS.Pipeline
Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput
method on component "Data Conversion 0 - 0" (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
Any thoughts?
Instead of the Data Conversion Transformation, use a Derived Column Transformation. Create a new Boolean column with an Inline IF, so that if the input value is "True" it outputs 1, else 0. Then use the new column in your destination.

Data conversion failed -"The value could not be converted because of a potential loss of data."

I have a simple data flow where I read data out of a table, do some data conversions, and load it into another table:
However when I run the package I get the following errors:
Error: 0xC02020C5 at Atish to CRM, Data Conversion [142]: Data conversion failed while converting column "CAMPAIGNID" (27) to column "Copy of CAMPAIGNID" (206). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
Error: 0xC0209029 at Atish to CRM, Data Conversion [142]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Data Conversion.Outputs[Data Conversion Output].Columns[Copy of CAMPAIGNID]" failed because error code 0xC020907F occurred, and the error row disposition on "Data Conversion.Outputs[Data Conversion Output].Columns[Copy of CAMPAIGNID]" 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.
Error: 0xC0047022 at Atish to CRM, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Data Conversion" (142) failed with error code 0xC0209029 while processing input "Data Conversion Input" (143). 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.
My mappings:
Lastly since the error seems to be complaining about 'CAMPAIGNID', the datatype of it on the destination table is uniqueidentifier. I honestly don't know what I'm missing here.
You are converting CAMPAIGNNAME to uniqueidentifier and CAMPAIGNID to string[DT_STR]. However your description seems to indicate that CAMPAIGNID must be uniqueidentifier
Also as per the error, your settings seem to indicate Failure on error. If you are sure that the conversion is correct and there will be no truncation, then you can change that property to Ignore on error. Alternately, you can use Error output and redirect it to another destination and inspect the results.
Also it is unclear why you are converting all the columns. Adding datatypes of your source and destination columns might add more clarity.

I am trying to Import a CSV file into SQL Server 2008

Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "Solution" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
Error 0xc020902a: Data Flow Task 1: The "output column "Solution" (90)" failed because truncation occurred, and the truncation row disposition on "output column "Solution" (90)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
Error 0xc0202092: Data Flow Task 1: An error occurred while processing file "C:\Users\siddhary\Desktop\Created interactions1.csv" on data row 2.
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Created interactions1_csv" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
Please can any one help me....
The column called solution has data consisting of text & special characters, I have specified that column as NVARCHAR(MAX).....
1st thing Id check is- Open up your flat file connection manager, select the column that's being imported and see what the data type is set to -
Check the Output Column width and increase if its small

Resources