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


Nesting Stored Procedures


Nesting Stored Procedures

Author
Message
ntaylor-739763
ntaylor-739763
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 41
I understand that I can use stored procedures from another stored procedure quite happily and merrily and have done so many times in the last 2 months.

What I'm really struggling with, though, is how to get a handle on the results from said stored procedure within the calling procedure.

A stored procedure can return a results table, a scalar value or nothing and VB handles those result sets perfectly well.

But when I try to use those exact same procedures (and let's face it; isn't that the main point of a stored procedure?) in another stored procedure I find it very, VERY difficult to access any part of the result except the return code.

So far the only stored procedures I've been able to use really properly are "action only" procedures with NO returned results.

If I want to see the result of the SP the only option I've found for doing so is to do an insert into a table variable; which has to be defined with every field coming back from the procedure because there's no means to select the fields you want before inserting them. Not only is that an incredible pain in the rear but it's also a huge violation of best practices for any RDBMS because it means you can't add fields to the result table without amending every procedure that calls it.

Isn't there some way; even if it means adding an intervening object, that will allow me to use the results of a stored procedure just like the results of a SELECT statement the way VB does?
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