ROWCOUNT
Example
Section titled “Example”SET ROWCOUNT 5;SELECT *FROM Products;Output
Section titled “Output”ProductID ProductName SupplierID CategoryID QuantityPerUnit UnitPrice UnitsInStock UnitsOnOrder ReorderLevel Discontinued1 Chai 1 1 10 boxes x 20 bags 18 39 0 10 02 Chang 1 1 24 - 12 oz bottles 19 17 40 25 03 Aniseed Syrup 1 2 12 - 550 ml bottles 21 13 70 25 04 Chef Anton's Cajun Seasoning 2 2 48 - 6 oz jars 22 53 0 0 05 Chef Anton's Gumbo Mix 2 2 36 boxes 21.35 0 0 0 1Explanation
Section titled “Explanation”In the SQL code example, the SET ROWCOUNT 5; statement is limiting the number of rows returned by the SELECT * FROM Products; statement to 5 rows. This allows users to limit the results of their queries to a manageable number.