why does Foreach Loop container of SSIS Package read same file!?

Abdullah Saad Alshehri 1 Reputation point
2020-12-28T07:26:29.38+00:00

Hi

I've created SSIS package to import data from multiple excel files in a folder. The package is working fine but it reads the first excel file and repeat this operation according number of excel files in the folder, for example : if there 10 excel files the package will read the first excel file 10 times.

what is wrong with that?

SSIS package "C:\Users\Administrator\source\repos\SSIS-ETL\Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Warning: 0x80049304 at Data Flow Task, SSIS.Pipeline: 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.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x402090DF at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion in "OLE DB Destination" has started.
Information: 0x402090E0 at Data Flow Task, OLE DB Destination [39]: The final commit for the data insertion  in "OLE DB Destination" has ended.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "OLE DB Destination" wrote 72 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
SSIS package "C:\Users\Administrator\source\repos\SSIS-ETL\Package.dtsx" finished: Success.
The program '[8968] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).

BR

Abdullah

SQL Server Integration Services
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,586 Reputation points
    2020-12-28T10:42:02.493+00:00

    what is wrong with that?

    Without having the package to look it up, I can only guess: The flat file connection manager still uses one fix filename instead the file name parameter from the ForEach loop. In "connections manager => Properties => Expression" check if the file name variable is assigned to property "ConnectionString"

    0 comments No comments

  2. Monalv-MSFT 5,926 Reputation points
    2020-12-29T03:28:09.73+00:00

    Hi @Abdullah Saad Alshehri ,

    1. Could you please share the screenshots of your SSIS package?
    2. Please check if you set the Excel File Path property using expression in the properties of Excel Connection Manager.
      Please refer to the following pictures:
      51896-cf.jpg
      51911-variablemappinginflc.png
      51844-setexcelfilepathproperty.png
      51853-dragvariabletoexpression.png

    Best Regards,
    Mona

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues in November--What can I do if my transaction log is full?
    Hot issues in November--How to convert Profiler trace into a SQL Server table?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.