How to map the value to the variable dynamically in Execute Process Task : SSIS Package?

How to fetch value from a variable in the Process Task in SSIS?

In the Control Flow : - I have  

1 ) Execute SQL Task - > In which i have a select query which fetches 3 row of records. Each mapped to 3 variables.
Variable is mapped to pick the folder path value which is configured in the database.

2) Execute Process Task -> Property ->
                                       Executable ->  I have mapped the physical folder path to it. ( Hard Coded ).

Objective : To get the value of Folder Path from SQL Database and assigned to the variable.

How to map the value to the variable dynamically in  Execute Process Task : SSIS Package?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Doug BishopDatabase DeveloperCommented:
You can create a variable in your package. Create an Execute SQL task with code similar to:
SELECT ? = TOP 1 my_column FROM myTable
Then in the task's Parameter Mapping tab, select the variable you created and set direction to Output.
Doug BishopDatabase DeveloperCommented:
In the flat file (or whatever format you are exporting to) connection,  you would use that variable as the path for the destination using an Expression to define the path.
For example: ConnectionString = @[User::FolderPath] + "myFile.txt"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.