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)
 Stored Procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-26 : 09:12:35
Cagatay writes "I have 4 different stored procedure. They work on different tables. I want to show their results on a web page. Because they bring more that 500 hundred records, I want to sort and show these results 20 by 20. Thanks for your help.

SQL 2000
Windows 2000 Pro."

nr
SQLTeam MVY

12543 Posts

Posted - 2002-02-26 : 09:38:10
If you look in the faqs you will see some articles on paging.
In essence

select top 20 * from (select top 40 * from tbl order by id) as a order by id desc

will get the second 20 or so
You can use a temp table or table variable to make things easier if you wish.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

lfmn
Posting Yak Master

141 Posts

Posted - 2002-02-26 : 13:23:32
there is also a web site http://www.4guysfromrolla.com/ which has articles on paging

Access is a virus!
Go to Top of Page

Sam Lewitan
Starting Member

3 Posts

Posted - 2002-02-27 : 12:28:41
Take a look at http://www.adopenstatic.com/experiments/recordsetpaging.asp also.
I personally am using his adOpenForwardOnly/GetRows Method
though I haven't yet found a good way to use this method for a dynamic list of search criteria (please see http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=13150)
Sam

Go to Top of Page
   

- Advertisement -