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)
 How to Grab Rows in Sets?

Author  Topic 

writhe
Starting Member

15 Posts

Posted - 2002-05-19 : 00:34:51
I'd like to grab sets of rows from a query, one set at a time. For example, if I have the query


SELECT * FROM Orders WHERE OrderID < 1000


how can I retrieve a set of, say, 30 rows at a time? I'd like to be able to tell the query, "grab the first set of 30, grab the second set of 30, grab the third set of 30," etc.



Edited by - writhe on 05/19/2002 00:36:13

Edited by - writhe on 05/19/2002 00:36:58

Nazim
A custom title

1408 Posts

Posted - 2002-05-19 : 01:02:03
check for SET ROWCOUNT in BOL and play with it

--------------------------------------------------------------
Go to Top of Page

writhe
Starting Member

15 Posts

Posted - 2002-05-19 : 01:06:12
Okay, I shall.

Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-05-19 : 01:39:23
will like to Add more. Check in Forum Search for Rowcount esp the posts by Robvolk . he has done this lot of times. you just have to loop using Set Rowcount.

Check this Article by graz http://www.sqlteam.com/item.asp?ItemID=566

--------------------------------------------------------------
Go to Top of Page
   

- Advertisement -