EddieIT
asked on
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.
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.
ASKER
Can you please provide and example of an expression to use for SQL statements?
Something like this:
"update dbo.mytable set myfield = getdate() where FileName = '" + (DT_WSTR, 20)@[User::FileName] +"'"
"update dbo.mytable set myfield = getdate() where FileName = '" + (DT_WSTR, 20)@[User::FileName] +"'"
ASKER
Can u send a screenshot of a configured expression?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://technet.microsoft.com/en-us/library/ms140355.aspx
http://www.sqlsafety.com/?p=276