ALTER PROC SP_SampleInner
AS
SELECT COUNT(*) FROM TB_Whatever
Other procedure
ALTER RPROC SP_SampleOuter
AS
DECLARE @count int
EXEC @count = SP_SampleInner
IF @count > 0
BEGIN
SELECT 1
END
ELSE
BEGIN
SELECT 0
END
What I want is SP_SampleOuter returns more than one table because of EXEC SP_SampleInner (I think). How could I control returning tables/values?
Try this approach:
Simply add the count variable as the first field you return