Groups | Blog | Home
all groups > sql server programming > may 2004 >

sql server programming : Find page of record using custom paging algorythm.


Jim M
5/29/2004 8:54:17 PM
I have a method of paging through an SQL table using (top 20 reocrds where
not in top 80 records) as an example.

To find the proper page to display (that has the record i need), how can I
find the location in a query for a givin record ID.

In otherwords, is there a way to check an SQL recordset as follows...

Select (Number of records before I hit [record_id] in tblAccounts where
state = 'CA'

Of course I could loop through the table until I found the record_id, but
this seems to be inefficient.

Thanks in advance,

Jim

Aaron Bertrand [MVP]
5/29/2004 9:39:03 PM
Have you looked at the paging examples at http://www.aspfaq.com/2120 ?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


[quoted text, click to view]

AddThis Social Bookmark Button