AFAIK, this is by design. The TOP clause needs to be a constant to work correctly.
You could try using SET ROWCOUNT, like this:
CREATE PROCEDURE proce
@i int
AS
SET ROWCOUNT @i
SELECT * FROM userinfo
Look in the Books Online for SQL Server and read about the TOP Keyword. That topic also discusses the differences between using TOP and using SET ROWCOUNT
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.