Using Sproc for Paging

  • Hello Everyone

    I am working on an old SQL 2000 database that has a couple different procedures that are used for paging. There are many better ways I know.

    But I would only like to modify one of these to a more efficient way. What I am asking is, does anyone already have some code that is used for paging that I can look thru to create new? The code that I have currently is almost 800 lines. Totally whacked. Which is exactly what I would love to do to the person that created this mess.

    Thanks

    Andrew SQLDBA

  • i know 1 way of passing page number as a parameter and returning only those many number of rows particular to that page out of total rows.

    But this is not much efficient as it fetches all records for each procedure call in the intermediate table with identity column.

  • I know of a pretty fast way using dynamic SQL... but I need more detail in order to help.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply