Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Combine three different Stored Procedures in one result setI have one procedure “ProcedureA”. I am calling this procedure in PROCBWhen I run PROCB It will return three result sets. Bcoz each ProcedureA will return col1, col2, col3. So I wan to combine the those result set.ProcedureA Col1ProcedureA Col2ProcedureA Col3I want like this. …without using temp table or union COL1, COL2, COL3
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-07-30 : 08:52:37
ProcedureA return the result via the OUTPUT parameter or a result set ? The result set is single column, single row ?KH[spoiler]Time is always against us[/spoiler]
WoodHouse
Posting Yak Master
211 Posts
Posted - 2009-07-30 : 08:55:08
HiIt's result set it's ....return single column but multiple rows...
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-07-30 : 08:59:33
[code]create table #t1 (id int identity, col1 int)create table #t2 (id int identity, col2 int)create table #t3 (id int identity, col3 int)insert into #t1 (col1) exec ProcedureAinsert into #t2 (col2) exec ProcedureAinsert into #t3 (col3) exec ProcedureAselect t1.col1, t2.col2, t3.col3from #t1 t1 inner join #t2 t2 on t1.id = t2.id inner join #t3 t3 on t1.id = t3.id[/code]KH[spoiler]Time is always against us[/spoiler]
WoodHouse
Posting Yak Master
211 Posts
Posted - 2009-07-30 : 09:02:54
Hi thanks.....but without using #temp ...is possible...?
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2009-07-30 : 09:05:20
No. Can'tKH[spoiler]Time is always against us[/spoiler]