Paging Advice Needed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Feuersteiner

    Paging Advice Needed

    Dear Group

    A while ago I've asked how paging is possible and have read the articles on
    aspfaq.com. Great work, esp. the speed comparison of all the different
    techniques. Thank you to everyone who has responded to my post. Somewhow
    Google didn't let me reply to the thread!

    All of the methods described work perfectly fine until I'm trying to
    implement a WHERE or ORDER BY DESC on a particular field. E.g. Create all
    pages but sort on a date field DESC doesn't start with the lowest date on
    the first page and the highest date on the last page but all dates mixed up.

    As a workaround I'm at first using a cursor to populate a temporary table
    e.g. SELECT * FROM MyTable WHERE MyField1 = Condition ORDER BY MyField2
    which only contains the data I would like to use to create the pages. I'm
    using a cursor since I read that a normal SELECT to poulate the temporary
    table doesn't always guarantee that rows are inserted in the correct order.

    Next I'm creating the individual pages with the Count and Page.Rank method
    off the temporary table.

    This method is not the best in performance and I'm sure there must be
    another
    way to perform paging with filtering and sorting. I'm grateful for any tipps
    you have.

    Thanks for your time & efforts!

    Martin



  • Martin Feuersteiner

    #2
    Re: Paging Advice Needed

    Hi!
    Just letting you know that I've found an answer to my problem at


    titled 'Sorting and Paging in SQL Server' (including Filtering).
    It's easy to use and pretty fast!

    Martin


    "Martin Feuersteiner" <theintrepidfox @hotmail.com> wrote in message
    news:c5rqu3$efu $1@titan.btinte rnet.com...[color=blue]
    > Dear Group
    >
    > A while ago I've asked how paging is possible and have read the articles[/color]
    on[color=blue]
    > aspfaq.com. Great work, esp. the speed comparison of all the different
    > techniques. Thank you to everyone who has responded to my post. Somewhow
    > Google didn't let me reply to the thread!
    >
    > All of the methods described work perfectly fine until I'm trying to
    > implement a WHERE or ORDER BY DESC on a particular field. E.g. Create all
    > pages but sort on a date field DESC doesn't start with the lowest date on
    > the first page and the highest date on the last page but all dates mixed[/color]
    up.[color=blue]
    >
    > As a workaround I'm at first using a cursor to populate a temporary table
    > e.g. SELECT * FROM MyTable WHERE MyField1 = Condition ORDER BY MyField2
    > which only contains the data I would like to use to create the pages. I'm
    > using a cursor since I read that a normal SELECT to poulate the temporary
    > table doesn't always guarantee that rows are inserted in the correct[/color]
    order.[color=blue]
    >
    > Next I'm creating the individual pages with the Count and Page.Rank method
    > off the temporary table.
    >
    > This method is not the best in performance and I'm sure there must be
    > another
    > way to perform paging with filtering and sorting. I'm grateful for any[/color]
    tipps[color=blue]
    > you have.
    >
    > Thanks for your time & efforts!
    >
    > Martin
    >
    >
    >[/color]


    Comment

    Working...