Similar Problems
How do I programmatically limit the number of rows in MS SQL?
TweetI would like to be able to limit the number of rows using a variable. SELECT TOP only allows integer, so SELECT TOP @RowLimit is invalid.
Credit: Original Poster
8 years ago by |
You can do this by using the rowcount keyword as follows:
SET ROWCOUNT @RowLimit
SET ROWCOUNT 0 |