In SqlServer 2005 and up, do this:
CREATE PROCEDURE GetResults (
@ResultCount int
)
AS
SELECT top(@ResultCount) FROM table where x = y
For earlier versions, use:
CREATE PROCEDURE GetResults (
@ResultCount int
)
AS
SET ROWCOUNT @ResultCount
SELECT * FROM table where x = y
http://www.4guysfromrolla.com/webtech/070605-1.shtml for more information.