Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning n rows from a table

Status
Not open for further replies.

DanSeal

Programmer
Jan 6, 2003
5
GB
Hi, i'm trying to work out how to return n number of rows from a table, where n is some number. I am not bothered what the data is, i just want to be able to return say, the top 100 rows in the table.

Thanks,

Danny
 
For Sybase (and probably MS SQL Server) use

set rowcount n
select rows from table
set rowcount 0

Greg.
 
The article on techtarget did the job. Thanks guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top