Returning Only Those Records on Page N
I am constructing a web-based application that displays search results one
page (say 20 records) at a time. The data resides in SQL Server 7.0.
Rather than returning all records meeting the query conditions to the application
tier, I would like to return only those for a specific page. For example,
if I pass in a page number parameter of 5, I would get back just records
81-100. I realize I could specify TOP 100 and then discard the first 80 in
my application tier, but I don't want that performance hit when the page
number gets higher.
Is there an efficient, scalable approach for doing this in a stored procedure
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center