In SQL Server, you can use SET ROWCOUNT
to limit the rows returned by a query.
The way it works is that it causes SQL Server to stop processing the query after the specified number of rows are returned.
It’s similar to the TOP()
clause, but with the difference that SET ROWCOUNT
is set outside of the query, and will affect all subsequent queries.