Try,
SET ROWCOUNT 10
select * from MyTable
Top 10 records will be returned
Regards-
Main Topics
Browse All TopicsIs it possible to limit the number of rows returned in a query?
If I use set rowcount 10, will it set the limit for just my connection ?
With MSSQL I can use select top n,
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
SET ROWCOUNT is the simplest way to limit the number of rows in the result set. It only applies to your connection. Don't forget to SET ROWCOUNT 0 to reset the option to allow all rows.
There is no "rownum" by default in ASE, though another approach is to select the result set plus an identity column into a temp table and then use the identity column as a rownum to select a subset of the result set. Example:
select *, identity(9) as "rownum"
into #foobar
from sysindexes
select id, name from #foobar
where rownum between 22 and 42
drop table #foobar
Business Accounts
Answer for Membership
by: william_jwdPosted on 2004-04-08 at 09:16:11ID: 10784754
try
where rownum < 11