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)
 Returning multiple rows in a single recordset

Author  Topic 

sona
Yak Posting Veteran

68 Posts

Posted - 2001-12-07 : 00:45:33
hello,

While <condition>
Begin
:
:
Select column1,column2 from Table
:
:
End

The thing is i have to return the selected rows back to the client.
Is there any way that i return all the rows selected within the while loop in a single recordset to the client without using a
TempTable


Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-07 : 00:50:18
Basically, no. Not like that.
You could use a union, but that won't help if you need the loop.

Temp table or table varible is really your only option.



Damian
Go to Top of Page

sona
Yak Posting Veteran

68 Posts

Posted - 2001-12-07 : 00:53:55
Okay, Help me with this.

I use a cursor
I tried to avoid cursor with that of temp table.
But both took same time with quite few number of records.
But if my records are gonna to increase which one is the best.


Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-07 : 00:59:26
well, if you want to return records in one set, the cursor won't do you any good at all.

I would go with temp tables, or if you are using SQL2000 use table variables.

Damian
Go to Top of Page
   

- Advertisement -