Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS - Exec SP in Data flow Expand / Collapse
Author
Message
Posted Monday, August 5, 2013 9:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 14, 2013 6:04 AM
Points: 8, 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?
Post #1480978
Posted Monday, August 5, 2013 11:27 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, April 4, 2014 4:41 AM
Points: 222, Visits: 194
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
Post #1481016
Posted Monday, August 5, 2013 1:05 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, August 14, 2013 6:04 AM
Points: 8, Visits: 28
I am not passing anything to the SP. I need it to return the values from the select statement inside the SP.
Post #1481054
Posted Monday, August 5, 2013 1:24 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 11:36 AM
Points: 493, Visits: 1,867
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.
Post #1481060
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse