Rownun under msql

What is equivalence  rownum(oracle) under MSql ?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you want to receive only 10 top rows (for example) from pubs.authors table,
you may do the following:

1. For version 6.5:

   set rowcount 10
   select * from pubs.dbo.authors

   This brief description on T-SQL:
Causes SQL Server to stop processing the query after the specified number
of rows are returned. To turn this option off (so that all rows are returned),

2. For version 7.0:

   select top 10 * from pubs.dbo.authors

   This brief description on T-SQL:
Specifies that only the first n rows are to be output from the query
result set. If PERCENT is also specified, only the first n percent of
the rows are output from the result set. When specified with PERCENT,
n must be an integer between 0 and 100."

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.