How to Use Rowcount in SQL Server

Posted By  youngmurukan On 07 Apr 2010 08:04:25
emailbookmarkadd commentsprint
No of Views:749
Bookmarked:0 times
Votes:0 times

Introduction

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

 

Image Loading


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

Thank you

Sign Up to vote for this article
Other popular Tips/Tricks
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top