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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using only one dataset

Author  Topic 

yoggi123
Starting Member

29 Posts

Posted - 2005-01-17 : 09:40:26
Hey,

I am using the following stored procedure, but as it is now it returns 2 datasets. I need it to return only 1.

ALTER PROCEDURE dbo.Test2
(
@Location varchar(250),
@FromDate datetime,
@ToDate datetime
)

AS
SET NOCOUNT ON

CREATE TABLE #Temp1 (themonth varchar(12), theyear varchar(12), averagedaystofilltotal float, averagefillratetotal float,
delaytimetotal float, responsetimelagtotal float)

INSERT INTO #Temp1(themonth, theyear, averagedaystofilltotal, averagefillratetotal, delaytimetotal, responsetimelagtotal)
EXEC rptStatsGraphicalYEARoverYear @Location, @FromDate, @ToDate

Create table #Temp2(averagedaystofilltarget float, averagefillratetarget float, responsetimelagtarget float)
INSERT INTO #Temp2(averagedaystofilltarget, averagefillratetarget, responsetimelagtarget)
EXEC Test1

SELECT * FROM #Temp1
Select * from #Temp2

drop table #Temp1
drop table #Temp2

Would anyone have any suggestions on how to modify this procedure so that it returns only one dataset, but yet still keeps the data seperated? Or is this even possible?


Thanks

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-17 : 09:46:08
this will return 2 dataTables in one dataset in ado.net
or 2 recorsets in ADO 3.0.

if you really want it to be one i guess you could do something like
select * from #temp1
union all
select dummyvalues
union all
select * from #temp2

but this would require the same number of columns in all selects... although i don't know why would
you want to do ot like that

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -