SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS - Exec SP in Data flow


SSIS - Exec SP in Data flow

Author
Message
ugh3012
ugh3012
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 Visits: 28
I have a SP that does bunch of stuff. It ends with a select statement from a temp table. How do I invoke that SP and send the output to a Destination in Data Flow?
suresh.arumugham
suresh.arumugham
SSC Veteran
SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)SSC Veteran (295 reputation)

Group: General Forum Members
Points: 295 Visits: 292
1. Use the OLEDB source component. In the source editor, choose the 'Data Access Mode' as SQL Command.
2. In SQL Command Text, provide the procedure to be executed. Eg : Exec USP_MyCalc ?, ?
3. Use the parameters button in order to pass the relevant values from SSIS variables. Map them to the name of the params in procedures. (@param1 = @User:choice1)
4. You might not be able to view the columns( in the source editor) because the stored procedures do not provide the metadata.
5. Now you can map the output data of the source to a transformation component or a destination as you desire.

Regards,
Suresh
ugh3012
ugh3012
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 Visits: 28
I am not passing anything to the SP. I need it to return the values from the select statement inside the SP.
kl25
kl25
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1142 Visits: 1875
ugh3012 (8/5/2013)
I have a SP that does bunch of stuff. It ends with a select statement from a temp table. How do I invoke that SP and send the output to a Destination in Data Flow?


If I understand your question, you're looking to take the results from the select at the end of the stored procedure and use it as the source in a data flow. To do this, set up the OLEDB data source using the proper connection manager. In the source editor, data access mode, select SQL command. For the SQL command text, invoke your stored procedure. When you check the columns in the editor, you should see the columns from the select at the end of your stored procedure.


[Edit, follow-up] I apologize--I missed that the table at the end of the procedure was a temp table. The process I described works for a permanent table. I've not worked with a temp table as a source but the following references may be helpful:
1. MSDN Discussion
2. MSSQLTips Problem/Solution

Neither address the exact scenario you describe but may point you in a helpful direction.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search