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

UNION between two stored procedures? Expand / Collapse
Author
Message
Posted Tuesday, June 22, 2010 12:55 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, October 17, 2014 2:18 PM
Points: 2,039, Visits: 3,485
Just curious: is it possible to perform a UNION between two stored procedure executions (that both return identical data formats)?
Post #941301
Posted Tuesday, June 22, 2010 1:07 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:25 AM
Points: 40,172, Visits: 36,566
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 2008, MVP
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

Post #941308
Posted Tuesday, June 22, 2010 1:18 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, October 17, 2014 2:18 PM
Points: 2,039, Visits: 3,485
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!
Post #941316
Posted Wednesday, October 17, 2012 10:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 18, 2012 3:01 PM
Points: 2, Visits: 3
Hi try this link for detail..http://codingresolved.com/discussion/73/how-to-union-two-stored-procedures-results-in-mssql-2005#Item_2
Post #1373940
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse