SSIS package, ForEach Loop Container Variable pass to SQL stored procedure

Hello Experts, I have created a For Each Loop Container in SQL2012 which reads and imports flat files Into SQL table. After the import is done, I need to update the SQL records with the file name used to create the records. In SQL2008R2, I do this with no issues using the SQL task, however in SQL2012, I'm not able to pass the variable of the file name successfully. Please let me know if you have any available examples.
EddieITAsked:
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.

Easwaran ParamasivamCommented:
You can pass parameter using ParameterMapping. Please do refer below links:
http://technet.microsoft.com/en-us/library/ms140355.aspx
http://www.sqlsafety.com/?p=276
0
Randy Knight, MCMPrincipal ConsultantCommented:
Try using an expression to build your update statement in the Execute SQL task.  This is sometimes easier and more reliable than using parameterized queries.
0
EddieITAuthor Commented:
Can you please provide and example of an expression to use for SQL statements?
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

Randy Knight, MCMPrincipal ConsultantCommented:
Something like this:

"update dbo.mytable set myfield = getdate() where FileName = '" + (DT_WSTR, 20)@[User::FileName] +"'"
0
EddieITAuthor Commented:
Can u send a screenshot of a configured expression?
0
Randy Knight, MCMPrincipal ConsultantCommented:
Here you go.  The Evaluate Expression button is useful so you can see the exact statement that will be executed.http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_28271971.html#
SSIS-Expression.png
0

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
Microsoft SQL Server

From novice to tech pro — start learning today.