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: Today @ 7:55 AM
Points: 1,655, Visits: 1,977
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
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:39 AM
Points: 2,332, Visits: 3,511
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)

Carl Sagan said: "There is no such thing as a dumb question." Sagan obviously never watched a congressional hearing!
Post #1578524
Posted Friday, June 6, 2014 3:44 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 7:55 AM
Points: 1,655, Visits: 1,977
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
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:39 AM
Points: 2,332, Visits: 3,511
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)

Carl Sagan said: "There is no such thing as a dumb question." Sagan obviously never watched a congressional hearing!
Post #1578557
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse