Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Leeds, UK

    Unanswered: pagination advice


    I'm still quite new to MSSQL so excuse the trivial questions.
    I've already tried searching through the forums on pagination as im sure its a big subject but couldn't find the answers i'm after.

    I'm using MSSQL 2000 and asp .net 2.0 and basically need to paginate my results. My database contains roughly 250,000 rows of data, and one query would approximately return 30 results at the most. I would want to have 5 results per page.

    I'm starting from scratch so was wondering what technique i could use. I can't use OFFSET as thats MySQL, is there an equivalent?
    I've heard mixed opinions on Cursors, but so far thats the only way i can see at the moment!


  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    No cursors, please.

    Use a query that assigns an ordinal value to each record in the recordset (you will need a unique column or group of columns by which you can reliably order the results).

    Then have your interface submit a request for a result set returning only rows N through M.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts