Click to See Complete Forum and Search --> : Stored Procedure Returns
JP
Sep 5th, 1999, 03:42 PM
I have a stored procedure that does a select and returns 0 or more rows as a result.
How can I determine how many rows are returned from this stored procedure within another stored procedure?
thx
JHausmann
Sep 6th, 1999, 09:21 PM
Something like (although I haven't tested it) the following should work:
CREATE PROCEDURE rows_returned
AS
DECLARE @printline as CHAR(80)
EXEC your_stored_procedure
select @printline = @@rowcount + " Rows selected"
PRINT @printline
[This message has been edited by JHausmann (edited 09-07-1999).]
JP
Sep 7th, 1999, 02:45 PM
Thanks, this works after putting a convert() around the @@rowcount when building the select for @printline.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.