Problem is...I will be provided with a command to execute a procedure...like EXEC SAMPLE_PROCEDURE_NAME
, I cannot modify or pass count/number to that procedure
Right now, on execution, the procedure is returning all the rows. I want to limit the number of rows that I receive back
Below are a few things I have tried (Procedure name = Demo4
)
This one failed
select top 10 * FROM (EXEC Demo4)
This one failed too
;WITH Results_CTE AS
(
EXEC Demo4
)
select top 10 *
FROM Results_CTE
This one failed too
DECLARE @tmpNewValue TABLE (*)
INSERT INTO @tmpNewValue
EXEC Demo4
select top 10 * FROM @tmpNewValue
I would really appreciate if someone can help on this.