SSIS ForEach loop through multplie excel files - ssis

I'm trying to parse through multiple excel files using Foreach Loop Container and getting the error blow. Whats annoying me is the for each loop works when the "Excel File Path" is set to 1 file in excel connection manager. But it loops through the same file multiple times. However, I need to loop through each file once and move to the next file. so I need to add an expression to excel connection manager. And its when I add an expression of the variable is when the error occurs
TITLE: Package Validation Error
Package Validation Error
ADDITIONAL INFORMATION:
Error at Data Flow Task [Excel Source [2]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager 1" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Error at Data Flow Task [SSIS.Pipeline]: Excel Source failed validation and returned error code 0xC020801C.
Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
Error at Data Flow Task: There were errors during task validation.
Error at Package [Connection manager "Excel Connection Manager 1"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft Office Access Database Engine" Hresult: 0x80004005 Description: "Invalid argument.".
(Microsoft.DataTransformationServices.VsIntegration)
BUTTONS:
OK

I had to set delay validation on the excel connection manager and everything else to get this to run OK

Related

An OLE DB error has occurred. Error code: 0x80040E37 - SSIS

I know that similar question has existed in SO before but none of them help with my issue.
What I am trying to do: I have an OLE DB source and excel destination. The destination points to a template and pushes out SQL data to that fine. Now, I want to generate excel file in a separate folder with timestamp in the file name.
What I did: In the 'Excel connection manager', I set the excel file path as
"S:\\ETL Lab\\CreateNewExcel\\ExportData_"+REPLACE((DT_STR, 20, 1252)(DT_DBTIMESTAMP)#[System::StartTime], ":", "")+".xls"
This location is same as where my template exists. Also after adding this path, I don't see any error. But When I execute the package I am seeing the below errors:
Error: 0xC0202009 at Data Flow Task, Excel Destination [2]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.
Error: 0xC02020E8 at Data Flow Task, Excel Destination [2]: Opening a rowset for "Sheet1$" failed. Check that the object exists in the database.
Error: 0xC004701A at Data Flow Task, SSIS.Pipeline: Excel Destination failed the pre-execute phase and returned error code 0xC02020E8.
Any help on how this can be fixed? :(

SSIS error DTS_E_INDUCEDTRANSFORMFAILUREONERROR when reading from a xls template with hidden row

(environment: Microsoft Visual Studio 2008, Version 9.03.30729, .Net Framework Version 3.5 SP1; I'm not using SQL Agent Job. )
I'm using SSIS to load data into a 1997-2003 version xls file.
To prevent number stored as text in the destination xls file, I'm using a xls template with the 2nd row hidden. In the hidden row, I put in number and format the cell as number. For the text column, I just left them blank.
The first task of the SSIS project is to make a copy of the template and put it in the destination folder with timestamp suffix in file name.
The project all ran ok if I use an xls template WITHOUT the hidden row.
But once I have the hidden row, I started getting the error as pasted below.
I appreciate your feedback and suggestion. thanks!
[Excel Destination [50]] Error: SSIS Error Code DTS_E_OLEDBERROR. An
OLE DB error has occurred. Error code: 0x80004005.
[Excel Destination [50]] Error: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Excel Destination
Input" (61)" failed because error code 0xC020907B occurred, and the
error row disposition on "input "Excel Destination Input" (61)"
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 "Excel Destination" (50) failed with
error code 0xC0209029 while processing input "Excel Destination Input" (61). 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.

"Key not valid for use in specified state." - SSIS Package

I have a SSIS package deployed in my server. My database is a SQL Server 2008R2, the SSIS was developed in Data Tools 2008.
It used to work perfectly but since a few days it started to throw this error:
Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available. End Error Error: 2018-03-27 15:15:37.25 Code: 0xC0016016 Source: Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available. End Error Error: 2018-03-27 15:15:37.84 Code: 0xC0202009 Source: Package Connection manager "MYDATABASE" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E4D. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E4D Description: "Login failed for user 'MYUSER'.". End Error Error: 2018-03-27 15:15:37.84 Code: 0xC020801C Source: XX Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "MYDATABASE" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed. End Error Error: 2018-03-27 15:15:37.84 Code: 0xC0047017 Source: Carga criticidad SSIS.Pipeline Description: component "XX" (1) failed validation and returned error code 0xC020801C. Description: One or more component failed validation. End Error Error: 2018-03-27 15:15:37.84 Code: 0xC0024107 Source: XX Description: There were errors during task validation. End Error DTExec: The package execution returned DTSER_FAILURE (1)
I already checked this post: SSIS: Just started getting a "Key not valid for use in specified state." error on my scheduled SSIS package
And i think it isn't the same because if a execute my ETL from the Data Tools, it works just fine. It only throws error when it executes by the SQL Agent
Does anyone know what could be this? I haven't changed anyuthing in the Server, Database or SSIS Package.

Conditional Split Transformation To Multiple Sheets In SSIS

I am trying to insert data into three excel sheets from a SQL table based on the condition given in SSIS Conditional Split Transformation.
When i run the package first time, it succeeds but after that i am getting the below error:
[Excel Destination [133]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
[Excel Destination [133]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Excel Destination Input" (144)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Excel Destination Input" (144)" 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 "Excel Destination" (133) failed with error code 0xC0209029 while processing input "Excel Destination Input" (144). 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.
This error is occurring to random excel destination. I am unable to find what is the cause.
Any help will be appreciated.
You need to load the 3 sheets sequentially. Attempting to load them simultaneously can cause contention issues. Reorganize your package so that the sheets are forced to load in order (sheet1, sheet2, sheet3).

SSIS Multiple-step OLE DB operation generated errors

Well, I don't how to explain this problem, I have two OLE DB Connections that i need to merge and send to an oledb Destination, the source oledb columns are:
tbl clientes totales:
RUT_CLIE numeric(18,0),
DV(string(1)), CLI_NOM(string(40)),
CLI_CAT_SUB(string(3)),
CLI_STA(string(5)),
CLI_SUB_STA(string(5)),
**COD_CTR (numeric(18,0)) <- JOIN KEY**,
nom_ejec(string(50)),
nom_suc(string(100)),
nom_suc_gpo(string(100)),
zonal(string(50)),
id_cargo(string(50)),
CLI_GRP_NOM(string(25)),
CANAL(string(50)),
ACTIVO(int),
VINCULADO(int),
VINCULADO_TRX(int),
CTACTE(int),
CLI_CAT(string(5))
tbl cartera 1 1:
cod_cartera (numeric(18,0)) <- JOIN KEY
cargo(string(100)),
nom_suc_gpo(string(100))
Destination:
Mapping:
I need to convert many of the columns into nvarchar(255), (I think that's the problem), but when I run the program, this happens:
Error Messages:
[OLE DB Destination [5679]] Error: SSIS Error Code DTS_E_OLEDBERROR.
An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record
is available. Source: "Microsoft SQL Server Native Client 10.0"
Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation
generated errors. Check each OLE DB status value, if available. No
work was done.".
[OLE DB Destination [5679]] Error: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "OLE DB Destination
Input" (5692)" failed because error code 0xC020907B occurred, and the
error row disposition on "input "OLE DB Destination Input" (5692)"
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 "OLE DB Destination" (5679) failed
with error code 0xC0209029 while processing input "OLE DB Destination
Input" (5692). 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.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The
ProcessInput method on component "Sort" (4898) failed with error code
0xC0047020 while processing input "Sort Input" (4899). 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.
Warnings:
[SSIS.Pipeline] Warning: Warning: Could not open global shared memory
to communicate with performance DLL; data flow performance counters
are not available. To resolve, run this package as an administrator,
or on the system's console.
Please help, i'm really frustrated and stressed right now, so I can't explain myself better, if you don't understand something, please ask and i'll try to make it better.
I can't be sure without seeing the actual column mappings in your OLE DB destination component, but the fact that COD_CTR is defined as NUMERIC(18,0) in tbl clientes totales and NVARCHAR(4) in RUTERO_FICHA_RED looks highly suspicious.
Edmund Schweppe gave me the idea, the problem was the Data Conversion, I must transform all the metadata into the same oledb destination, like this:
(Same Data Type as dbo.RUTERO_FICHA_RED table destination).
Thanks for the help!