DevSnips.com Code Snippet Repository
search:    


Navigation
  Home
About
Library
Contact
 
Snippet Library
  ColdFusion   338  
  ASP   201  
  PHP   101  
  HTML   11  
  JavaScript   77  
  XML   2  
  CSS   5  
  SQL   13  
  JSP   2  
  C#   1  
  ASP.NET   0  
  Submit a Code Snippet
 
Blog Archive
  September 2007
August 2007
July 2007
June 2007
May 2007
November 2006
October 2006
Search Archives
 
Random Affiliates
  Tom Morris
Uno-Code
PHP Arch
ReviewMe!

Want to become an affiliate?
Read more...


Privacy Policy
© 2012

Snippet Library

SQL - Structured Query Language (.sql)


SET ROWCOUNT

 
You're probably familiar with the typical "SELECT * FROM Table" SQL statement, which returns all the records in a table. By adding a WHERE clause to a SELECT statement, you limit the resultset to only those records that match the WHERE criteria. Although this may or may not limit the resultset, the number of records returned to the client is always unknown. To specify the number of records that are returned by a query, you can use either SET ROWCOUNT or the TOP keyword.
A SET ROWCOUNT statement simply limits the number of records returned to the client during a single connection. As soon as the number of rows specified is found, SQL Server stops processing the query. The syntax looks like this:

http://gethelp.devx.com/techtips/thesqlpro/10min/10min0600.asp
 
 
 
Go Back





Advertisements

http://promotions.newegg.com/Misc/free_shipping/in