For SQL2K:
SET ROWCOUNT @NumberOfRows
SELECT * FROM SomeTableOfYourChoice
SET ROWCOUNT 0
and for SQL2K5
SELECT TOP(@NumberOfRows) FROM SomeTableOfYourChoice
SET ROWCOUNT @NumberOfRows
SELECT * FROM SomeTableOfYourChoice
SET ROWCOUNT 0
SELECT TOP(@NumberOfRows) FROM SomeTableOfYourChoice
1 comment:
Sybase doesn't understand the TOP N syntax, so this is the way a Sybase developer always performs this task.
Post a Comment