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

Second resultset of stored procedure into a temp table - also, what's the best way to flay a develoer? Expand / Collapse
Author
Message
Posted Friday, June 6, 2014 2:45 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 6:30 AM
Points: 1,548, Visits: 1,889
I'm working on building a report and asked a developer which table some data comes from in an application. His answer was the name of a 3500 line stored procedure that returns 2 result sets. I could accomplish what I'm trying to do using the second result set, but I'm not sure how to put that into a temporary table so that I could use it.

I figured I'd see if anyone here has approached this issue.

Here's my plan according to the Kübler-Ross software development lifecycle:

Denial - Ask the developer to make sure this is correct (done)
Despair - Look hopelessly for a solution (where I am now)
Anger - Chastise developer
Bargaining - See if I can get him to at least swap the order that the resultsets are returned
Acceptance - Tell the users that this can't be done at present.

If someone knows how to get to that second resultset, I would appreciate not having to move on the third step.
Post #1578517
Posted Friday, June 6, 2014 3:04 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:16 PM
Points: 1,970, Visits: 2,911
Honestly, I'd probably kludge this one if possible.

See if you can add an optional flag as a parameter to the proc to indicate that the first result set is not to be returned, only the second. Then you can capture the output from the proc directly into a temp table, for example, since it will then be only one result set.


SQL DBA,SQL Server MVP('07, '08, '09)
"In America, every man is innocent until proven broke!" Brant Parker
Post #1578524
Posted Friday, June 6, 2014 3:44 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 6:30 AM
Points: 1,548, Visits: 1,889
You know, I never even thought of that! It's already going to be a kludge, so something a bit kludgier isn't going to make things that much worse. Thank you for the idea!
Post #1578536
Posted Friday, June 6, 2014 9:14 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:16 PM
Points: 1,970, Visits: 2,911
You're welcome! At least you don't need to change much of 3500 lines of code .

SQL DBA,SQL Server MVP('07, '08, '09)
"In America, every man is innocent until proven broke!" Brant Parker
Post #1578557
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse