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
 Transact-SQL (2000)
 Getting a specific range of results

Author  Topic 

Guran
Starting Member

17 Posts

Posted - 2005-07-20 : 15:44:10
I need to create a stored procedure that gets a specific range of results. It will pick out values from a table that contains guestbook entries. The page that will use this data should display it paged. That is the guestbook entries are divided into pages with say 20 posts on each page. The sproc I need should be able to take two parameters: the number of posts on a page and what page to get. For example if I specify I want 20 posts on each page and I want to see page 3, the sproc would return posts 41-60.
I have looked on keywords such as TOP but they are not enought. I really cant figure this one out so I need all the help I can get.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-07-20 : 16:29:32
Do both a forum search and a site search on "paging". There has been a lot of discussion and several articles here on this topic here.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -