user3115933
user3115933

Reputation: 4443

Modify my existing SSIS package to perform this specific operation

I have an SSIS package created using SSDT and running as a job on SQL Server 2014.

This SSIS package retrieves an Excel file (.xlsx) from a specific folder and exports its content into a specific table on my SQL Server database. The package runs fine.

My Data Flow is in the following sequence:

  1. Import Excel file from folder
  2. Apply a Conditional Split to split data with today's date
  3. Export the data into the SQL Server table in the database

Here is my problem:

I will now have 4 additional Excel files into that folder and they will need to be exported into that same SQL Server table.

So what is the best way forward to achieve this (assuming all of them are possible solutions):

  1. Rewrite 4 additional SSIS packages from scratch?

  2. Use “Save As” existing package with a new name (4 times) and modify the file name to be retrieved?

  3. Modify my existing SSIS package to accommodate for the additional 4 Excel files?

Any help would appreciated.

Upvotes: 0

Views: 160

Answers (1)

Andrew O'Brien
Andrew O'Brien

Reputation: 1813

Assuming the 4 excel files are the same structure and going to the same table, you'll want to use the ForEach loop for each file in the folder.

SentryOne has a good example of looping through each file in a folder and archiving. I imagine it can be adjusted for your use case.

Upvotes: 1

Related Questions