I have a stored procedure which returns multiple result sets similiar to the following:
ALTER PROCEDURE sp_XXXX
(
XXXXXX
)
AS
SET NOCOUNT ON
SELECT XXXXXXX
IF @@ROWCOUNT = 0
SELECT XXXXXXX
RETURN
I want my report to use the first result set if it has data or use the second one in case the first one is empty. Any help?