• lol - ok, nicely done. Somewhat more efficient than cursors 🙂

    Why don't you just build a table and then use a between? The following example is in T-SQL as it allows the handy table var (automatically cleared after sp exec)

    CREATE PROCEDURE getSubset (@start int, @end int) AS

    DECLARE @tblTemp TABLE (pID int,

    intData int,

    strData nvarchar(50))

    INSERT INTO @tblTemp

    SELECT /*insert main functionality of sp here*/

    SELECT *

    FROM @tblTemp

    WHERE pID between

    @start and

    @end

    ORDER BY intData

    Life's not difficult...enjoy it.

    Nood!e