This stored procedure implements a kind of
SELECT NEXT x TOP y Columns
FROM Table
WHERE Condition
ORDER BY Order.
It works on any table that has a unique id column and it works with any WHERE clause and any ORDER BY condition. The only drawback is its very poor performance on large tables. This is my first attempt to build a generic NEXT x TOP y solution so I would really welcome some comments and tips.
João Melo (joao.melo@inga.min-agricultura.pt)