Unexplainable error while writing data into Excel file in SSIS - sql-server

My DFT fetches data from an SP. It is followed by a conditional split to split dataset into 5 parts based on a column value. The sub-datasets are then written into an excel file. All 5 outputs write into the same excel file, But different tabs. I have explicitly mentioned the Column range and starting row for the data to be written. Data load into the Excel file fails with the following error.
[EXC DST EAC TREND HPS [1379]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
[EXC DST EAC TREND HPS [1379]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Excel Destination Input" (1390)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Excel Destination Input" (1390)" 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 "EXC DST EAC TREND HPS" (1379) failed with error code 0xC0209029 while processing input "Excel Destination Input" (1390). 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.
The most frustrating part is that the Excel destinations fail at random. Lets name them as A,B,C,D and E. During 1st run A will fail and the rest will write data successfully. During the 2nd run, A will succeed but C and E will fail and so on.
Every time the Excel Dest fails, data is still written in that particular tab. But I can see some blank rows in the dataset. I added a data viewer before each Excel Dest and the data looks correct. There are no blank rows either. number of rows per data set are fixed (18).
I am using a template every time which has only Column headers.
4 columns have datatype of nvarchar with max data length of around 50. 12 columns are Numeric(38,2).
Any help would be very much appreciated.
Thanks,
Gaz

Reorganize the package so that the writes will occur sequentially. The error you are seeing is the result of concurrency issues. You can't write to the same file in 5 different places at once. You have to do let each write finish before the next one starts.

Related

SSIS Data Conversion Failure. Potential Loss of Data when importing field with all "00000000" into a character field

I am trying to import data from a flat file into an SQL database. The data has been all stored as text and is giving an error when it gets to the first row of the D_FST_ADM field. This data is as follows "00000000". It does not have quotes around it in the file.
The errors I am getting are this:
[Flat File Source [240]] Error: Data conversion failed. The data conversion for column "D_FST_ADM" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".
[Flat File Source [240]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Flat File Source.Outputs[Flat File Source Output].Columns[D_FST_ADM]" failed because error code 0xC0209084 occurred, and the error row disposition on "Flat File Source.Outputs[Flat File Source Output].Columns[D_FST_ADM]" 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_PRIMEOUTPUTFAILED. The PrimeOutput method on Flat File Source 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.
I have tried changing the field in the database from a date field to an integer and then to character, with no luck.
I tried to create a derived field for it but with no success either.
Any help on this is greatly appreciated.

Importing CSV in SSIS: truncation error

I am importing a CSV file in SSIS having many string columns. I have set column width more than the maximum length, but still I am getting below errors
[Input CSV File [114]] Error: Data conversion failed. The data
conversion for column "Functionality" returned status value 4 and
status text "Text was truncated or one or more characters had no match
in the target code page.".
[Input CSV File [114]] Error: The "Input CSV File.Outputs[Flat File
Source Output].Columns[Functionality]" failed because truncation
occurred, and the truncation row disposition on "Input CSV
File.Outputs[Flat File Source Output].Columns[Functionality]"
specifies failure on truncation. A truncation error occurred on the
specified object of the specified component.
[Input CSV File [114]] Error: An error occurred while processing file
"D:\Prateek\SSIS_UB_PWS\January.csv" on data row 236.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The
PrimeOutput method on Input CSV File 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.
As a work around, I have set values to 500 or 1000 and now it is allowing me to continue, but the actual length is in double digit.
Kindly suggest what could be the possible error.
Check , what is the value of the column 'Functionality' at row number 236. And then , verify what is allowed. In the advanced editor of the source, you can increase the length(if there are not any special characters) if you are loading data into a table
Truncation warning appears when your source column length is bigger than destination column length, so it'll truncate the source value to fit into its destination. Could you share with us the length of the column length, and the length of destination column?
I got the error, sorry for my bad understanding of issue.
Actually one of the column is having multiple commas (,) in data and that was getting into other columns (Text delimiter was set to ). Hence I was getting bigger values than expected in other columns as well.
Thanks for you help!

SSIS. Importing several xlsx files

I'm stuck with a SSIS package that I created for importing xlsx files to a database. Since some files have data with more tan 255 characters, I setted that column to DT_NTEXT. If I just leave a xlsx file that I know that has this long data, the package works fine with no erros. But, if I leave all the files that need to be imported in the import folder, I get next erros:
[VENTA_IMS_EXCEL [1]] Error: SSIS Error Code DTS_E_OLEDBERROR.
An OLE DB error has occurred. Error code: 0x80040E21.
[VENTA_IMS_EXCEL [1]] Error: Failed to retrieve long data for column "F17".
[VENTA_IMS_EXCEL [1]] Error: There was an error with output column
"SubFamilia" (16693) on output "Excel Source Output" (9).
The column status returned was: "DBSTATUS_UNAVAILABLE".
[VENTA_IMS_EXCEL [1]] Error: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "SubFamilia"
(16693)" failed because error code 0xC0209071 occurred, and the error row disposition on
"output column "SubFamilia" (16693)" 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_PRIMEOUTPUTFAILED.
The PrimeOutput method on component "VENTA_IMS_EXCEL" (1) returned error code 0xC0209029.
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.
My guessing is that the problem is that it evaluates each file for the kind of data to work with, and in the cases that there is data with less tan 255 characters, it fails.
Can anyone help me with this? How can I solve this? So it can loop and import all files with no problems.
This is a common issue with excel files. The excel driver infers the datatype for each column based on the first 8 rows. Review what datatype is your datasource assigning to your column and then confirm that all values conform to this datatype.
Review this blog post: https://www.concentra.co.uk/blog/why-ssis-always-gets-excel-data-types-wrong-and-how-to-fix-it

What SSIS "error code 0xC0202092" means? (DTS_E_PRIMEOUTPUTFAILED)

Here it is below a full dump of the SSIS complains. Please note that I imported the same data in the destination table by using a different tool already and everything is looking perfectly, I suppose that means the schema of the destination table is correct. What do I have to do here to actually use SSIS (the entire process is automated, I did it manually now but that is not acceptable in long term...)
[Flat File Source [170]] Error: Data conversion failed.
The data conversion for column "City" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
[Flat File Source [170]] Error: The "output column "City" (203)" failed because truncation occurred, and the truncation row disposition on "output column "City" (203)"
specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
[Flat File Source [170]] Error: An error occurred while processing file "G:\Share\Nationwide Charities Listing.csv" on data row 120.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.
The PrimeOutput method on component "Flat File Source" (170) 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.
Your data contains unicode characters i guess and the destination is varchar(23). Try to change it to nvarchar(23) and then import ?
Use utf 8 and you will be fine. That is in the first screen after the welcome in the import export tool. That displays properly the accents.

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