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 2005 Forums
 Transact-SQL (2005)
 More than one output

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-09-12 : 07:43:22
I use temporary table to store data and then output to dataset in ASP.NET.
Is it possible to make more than one output so that I can create more dataset based on output? For example,
create table #temp (...)
insert #temp select * from order
select ID, order_date from #temp //(output 1)
select ID, order_city, order_amount from #temp //(output 2)

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-09-12 : 09:04:22
Yes. If you do that in a stored procedure, you will get two resultsets back.
And if you use .GetNextRecordset method or similar, you have access to both resultsets.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-09-12 : 14:41:24
Can you tell me how to code?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-09-13 : 03:52:39
http://www.freevbcode.com/ShowCode.asp?ID=3058
http://www.w3schools.com/ADO/met_rs_nextrecordset.asp
http://msdn.microsoft.com/en-us/library/ms677539(VS.85).aspx



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-14 : 02:22:59
In .NET dataset it is something like table(0),table(1),...

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -