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
 General SQL Server Forums
 New to SQL Server Programming
 Select 20 rows

Author  Topic 

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2008-07-19 : 10:55:44
Many of the asp pages are displaying 20 records per page.

i.e.
exapmle.com\test?page1 showing first 20 records.
next previous
exapmle.com\test?page2 showing next 20 records.

Is it purely asp based or SQL based?


____________
Praba

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-19 : 10:58:01
Could be anything.
Most practical is that ASP sends a parameter to database, and database returns that page records, and do the pagination at database.
This is the reduce network traffic.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2008-07-19 : 11:00:04
Can you tell me how to select 20 rows after the first 20 rows.

____________
Praba
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-19 : 11:15:04
For example see http://weblogs.sqlteam.com/peterl/archive/2008/02/19/Efficient-pagination-for-large-set-of-data.aspx
There are many other examples of pagination routines here at SQLTeam.


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-19 : 12:32:17
quote:
Originally posted by cutepraba

Can you tell me how to select 20 rows after the first 20 rows.

____________
Praba


you can use ROW_NUMBER() function to achieve this if you're using SQL 2005

http://blogs.x2line.com/al/archive/2005/11/18/1323.aspx
Go to Top of Page

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2008-07-19 : 12:38:07
I am using sql server 8

____________
Praba
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-19 : 13:07:00
quote:
Originally posted by cutepraba

I am using sql server 8

____________
Praba


then use Peso's solution.
Go to Top of Page
   

- Advertisement -