Returning small managable sets from a SELECT state

  • I have a Database that contains 10,000 records. I execute a SELECT statement that returns 8000. I need those 8000 and cannot refine my statement to return a smaller subset.

    My problem is I don't want all the results back in one go. I would like to return to 1000 rows on my first call. On my second call I would like another 1000 rows starting from the end of the last call and so on...

    Is this possible? Also the table has no unique key either, and that ain't gonna change.

    Any suggestions. I would like to implement this in SQL.

    Thanks in advance to anyone who comes up with a good solution

  • Insert the data into a temp table along with an identity column, then select back whichever set of rows you need using the ident to determine the range.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

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

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