select top 10 records without using TOP n clause

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 423
'SET ROWCOUNT ' option causes SQL Server to stop processing the query after the specified number of rows are returned.
SET ROWCOUNT overrides the SELECT statement TOP keyword if the rowcount is the smaller value.


-- Without using TOP n clause
SET ROWCOUNT 10
SELECT * FROM CITY ORDER BY CITY_NAME
SET ROWCOUNT 0

Comments or Responses

Login to post response