get filename dynamically iinside foreach loop | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

get filename dynamically iinside foreach loop

I am using a foreach loop to go through the .txt files inside a folder.
Using a variable I can pickup the filenames the loop is going through.
At present there is a sql task inside the foreach loop which takes the filename as a parameter and passes this filename to a stored procedure.
Now I would like to add one extra step before this sql task. Would like to have a dataflow with flatfile source which connects to oledb destination. The question is:
While in the loop, how is it possible to pass the filename to the flatfile source using the FileName variable which I have created? Please note, this is a different question to my other post. Many Thanks
place Data flow task inside the for each loop.
in Data flow task , you can assign variable to the connection string of the connection manager —————————————-
Contributing Editor, Writer & Forums Moderator
http://www.SQL-Server-Performance.Com Visit my Blog at