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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting rows returned from a stored procedure

Status
Not open for further replies.

oddball

Technical User
Mar 17, 2000
64
GB
Is there a simple way of returning only five results from the following stored procedure (ie those 5 companies who registered most recently)

==========================================================

ALTER PROCEDURE GetNewestCompanies

AS

SELECT
CompanyName,
RegDate

FROM
Company

ORDER BY
RegDate DESC

===========================================================

cheers,

si
 
Hi,

u can change the SQL like this to return 5 compnaies

SELECT TOP 5
CompanyName,
RegDate

FROM
Company

ORDER BY
RegDate DESC


Sunil
 
Cheers sunila7,

knew there must be a command to do it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top