how to pass variable value from one variable value from excute sql task to other ESQL task
-
Wednesday, May 02, 2012 1:57 PM
in my ESQL task sp is returning value as output parameter
how i can pass this value to another ESQL task
All Replies
-
Wednesday, May 02, 2012 2:01 PMModerator
You need to capture it into a package variable, then use as a parameter for the other Execute SQL Task. Please note, complex datatypes as object are not the best to pass around, only simple (string or integer) datatypes should be exchanged.
For a detailed how to capture the returned resultset please see http://www.simple-talk.com/sql/ssis/passing-variables-to-and-from-an-ssis-task/
Arthur My Blog

- Edited by ArthurZMVP, Moderator Wednesday, May 02, 2012 2:02 PM link added to an example
-
Wednesday, May 02, 2012 2:08 PM
hi arthur ,
in first esql task my output parameter is returning value
so in next esql task i want to use this output parameter as input and get the result
how to configure the 2nd esql task
- Edited by v60 Wednesday, May 02, 2012 2:09 PM
-
Wednesday, May 02, 2012 2:09 PM
Hi,
One more helpful example how to use Execute sql task with parameters
http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx
Thanks
Aamir
http://sqlage.blogspot.com/
-
Wednesday, May 02, 2012 2:17 PMModerator
hi arthur ,
in first esql task my output parameter is returning value
so in next esql task i want to use this output parameter as input and get the result
how to configure the 2nd esql task
The key is in the parameter mapping: http://phe1129.wordpress.com/2008/06/27/execute-sql-task-and-parameter-mapping/
I gave this link because you are not verbose about what kind of connection you are using (OLEDB, ADO, ODBC) they all have differences in how you map and what code you use to run the SQL.
Now, the thing is once you captured the output to the parameter you are almost set, you may see rafael Salas' gotcha on how to make this even generic or simpler if you wish: http://www.rafael-salas.com/2007/11/ssis-mapping-parameter-inside-of.html
Arthur My Blog

- Proposed As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Friday, May 04, 2012 5:30 AM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Wednesday, May 09, 2012 8:02 AM

