Second resultset of stored procedure into a temp table - also, what's the best way to flay a develoer?

  • 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.

  • 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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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!

  • 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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply