Use of Rowcount in SQL Server

We can use rowcount sql property to set the number of rows to be shown in the output.
for an example,
lets say there are 10 records in a table, if we set the rowcount to 5 then when retrieve records from that table, only 5 records will be shown.

if you rowcount to 0 then all records will be retrieved and shown in output.
  1. SET ROWCOUNT 5
  2. SELECT ref_num FROM tbl_po_master



in above example only 5 rows have been retrieved and shown in output as we set the rowcount to 5.

Comments

Popular posts from this blog

SQL SERVER – TRIM() Function – UDF TRIM()

Delete duplicate records from a Table in SQL Server