Link to home
Start Free TrialLog in
Avatar of chokka
chokkaFlag for United States of America

asked on

How to pick the value from SQL Table and assign to the variables which can be used for passing it to the Excel Source in the SSIS package?

Inside the Forloop each container; In the DataFlow Task, we have Excel Source file. Excel Source file is currently mapped to the source folder path.

We are making the changes to pick the folder path from SQL Table Configuration.  

We have a table name FileConfiguration which has Inbound file path, Archive file path.

How to pick the value from SQL Table and assign to the variables which can be used for passing it to the Excel Source in the SSIS package?
Avatar of Pratik Somaiya
Pratik Somaiya
Flag of India image

Use an Execute SQL Task in the Control Flow to obtain the Excel file path from the database, and put it into an SSIS variable. Then, in your Data Flow, use the variable for your data source file path.
Avatar of chokka

ASKER

Thanks !!

In my understanding , variable has to be global variable?? Where does the variable is created ?
ASKER CERTIFIED SOLUTION
Avatar of Pratik Somaiya
Pratik Somaiya
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chokka

ASKER

@Pratik ..

I have the Foreach loop Container -> Data Flow Task -> Excel Source File -> SQL Destination  Table.

How do i use the File Task on each ( file by file ) , once successful completion of loading -> Move the file to Archive

Then Start with another file.

Failure on the file loading, move that specific file to Error Folder. Proceed with next file loading.

How should i do that ?
Hi,

I would like to know that are all the files related to same table?

It should have same number of columns as your table has else you need to create a new package altogether for loading a different table.

If you want to load the table from all files one by one, then you can write a script task to perform such an operation.

Regards,
Pratik
Avatar of chokka

ASKER

Thank you
I'm happy that it worked for you