I'm using SQL Server 2000 and I have a stored procedure where it's possibly to return up to 20,000 rows from the select statement inside. I would like to use the TOP function to just return the top 500 rows, and if there are over 500 rows (which I'll find out from @@rowcount) then I would like to use the RETURN function to return a return-value to the calling application but also NOT return the 500 rows. I can do it this way but I don't want to: insert the data into a temp table or table datatype, do an @@Rowcount on that, then if @@Rowcount >= 500 then RETURN a different return-value, otherwise Select from the temp table so the calling application receives the data. I don't want to do that because I want to avoid the overhead of creating a temp table or table datatype, does anyone know any other way to do this? Thanks in advance.