October 23, 2006 at 6:29 am
hi,
in sqlserver,
how i have to query to display first 20 records in a first page,
next 20 records in the next page,next 20 in the next........... and so on.
from a database which has 4,00,000 records fastly.
October 23, 2006 at 5:23 pm
That's really not something for SQL Server to do. And it wouldn't happen fast - your query would have to go to the database, pull 20 records, go to the database, pull 20 records, go to the database.....until it got all 400,000 (or 4,000,000 whichever you meant) records. Very inefficient.
You should get all the records and pass them to the front end...then let the front end application page through the results.
-SQLBill
October 24, 2006 at 4:02 am
I agree with SQLBill.
Really not efficient. If your application requested 20 records with each call to the database, you'd end up with 200,000 calls to the database (400,000 in total between client and server).
I guess the key question though, is do you really need to retrieve all 4m rows of data? Even if you did need vast amounts of data, I would retrieve it in bigger chunks than 20 rows and allow the front end application to handle the 20 rows at a time and then make another call to the database when it needs more rows.
October 24, 2006 at 6:39 am
Hey guys I think he just needs a paging procedure. Anyone got sample coding around?
October 24, 2006 at 7:20 am
this might help:
http://databases.aspfaq.com/database/how-do-i-page-through-a-recordset.html
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply