UNION between two stored procedures?

  • Just curious: is it possible to perform a UNION between two stored procedure executions (that both return identical data formats)?

    +--------------------------------------------------------------------------------------+
    Check out my blog at https://pianorayk.wordpress.com/

  • Not exactly union, but you can insert the results of a proc into a table. Insert both result sets into a temp table, then query that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (6/22/2010)


    Not exactly union, but you can insert the results of a proc into a table. Insert both result sets into a temp table, then query that.

    I'm with you. I'm playing around with a web item that pulls data from a SP. However, I came across a scenario where this app needs to call the SP twice (using two different parameters). It's a very minor thing -- to the point that it's not worth rewriting the SP or spending any major effort on it. I was just checking to see if there was a quick 'n easy workaround. Not a big deal.

    Thanks for your help as always, Gail!

    +--------------------------------------------------------------------------------------+
    Check out my blog at https://pianorayk.wordpress.com/

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

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