"Paging" in SP

"Paging" in SP

Post by Thomas Nie » Fri, 08 Oct 2004 16:46:35

I need to searches through records using Full Text Indexing. A search often
returns hundreds of records, and need the user to be able to page through
the result 50 at a time. I *ALSO* need the user to know the first and last
record of each page! (..On the client, i render a list of all pages in the
resultset, and add labels to each page, indicating to the user where in the
resultset the page is positioned).

I have therefor done an SP that inserts my initial search into an in-memory
table. After that i loop through all the records from my initial search, and
insert every 50th record into a different in-memory table. That allows me to
return a resultset with a) the first page of records (first 50 records), and
a table with a complete list of pages.

However, it has come to my attention that my loop through my initial
resultset is taking a lot of performance. So basically, my question is:

i have a large resultset in memory. I need to "sample" records from this,
eg. every 50th record. What would be the fastest way of doing this?



"Paging" in SP

Post by David B. B » Sun, 17 Oct 2004 22:10:38

Take a look at a sample script I wrote for paging resultsets: