Selecting Next Record in Index

  • If I have one record is there a way that I can select the next and/or previous record in an Index

  • Sql works on sets of data. You can only retrieve what you ask for. Once the data is retrieved thats it, Sql server does not remember that you have a certain record. There may be some way to accomplish what you are trying to do using programming but it is not something that is intrinsically built into Sql Server.

  • You have to think of it terms of data, not the index. All the index does is order it. You can use an order by in a select to achieve the same thing.

    Andy

  • But you may have troubles unless this index is unique being able to get the previous and next without using a cursor.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

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

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