I need to select batches of N rows from a large table.
I know of two ways of doing this:
SET ROWCOUNT #### SELECT something FROM table WHERE clauses SET ROWCOUNT 0 -- rowcount is only needed for the one query above.
SELECT TOP ### something FROM table WHERE clauses
Is there any performance difference (or any other reason to pick one over another) between the two solutions?
- If it matters, Sybase ASE is version 15.
- The query is a single
SELECTstatement. The limit will not apply to any other statements (so usual reasons to pick rowcount over top don't apply).
- The order of the rows does not matter
- This SO Q&A has accepted answer which claims no difference without any supporting references; and another answer that shows a possible un-measured difference for MS SQL server (which I'm not sure applies to Sybase as the reference is from Microsoft).