Get the page number of a certain record to where it is included

  • hi!

    To put it simply, is there a way that i can get the page number or index to where a certain record is included?

    Given that Page Size, Record Id and Sort Direction are supplied as parameters.

    Thanks in advance!

  • There's an undocumented feature or two.

    I do have to ask though. Why?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • to elaborate,

    I am implementing a paginated data retrieval for our web app.

    We are retrieving dataset based on the page number given and the page size.

    I have the grid on left side and record information on the right.

    One requirement is that, a newly created record should be automatically selected

    on the grid. Our problem is, what if the newly created record is included not in the

    current page? What if it is in the third or fourth?

    My initial plan is to pass the newly created ID as a parameter and retrieve the

    dataset to where the record is included.

    I hope I have stated the requirement clearly and any idea would be a great help.

    Thanks!

  • In that case, you don't want to look at the physical storage locations (which is what I thought you were asking for)

    Have a read through this (and the discussion) see if it gets you started:

    http://www.sqlservercentral.com/articles/T-SQL/66030/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 4 (of 4 total)

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