User753101303 posted
Hi,
What do you get from your SP ? You could use maybe :
https://docs.microsoft.com/en-us/sql/t-sql/functions/rowcount-transact-sql?view=sql-server-2017
--CREATE PROCEDURE sp_test AS SELECT 1 WHERE RAND()>=0.5
GO
EXEC sp_test
IF @@ROWCOUNT=0 PRINT 'DO SOMETHING' ELSE PRINT 'SOMETHING ELSE'
GO
It sill returns the resultset. If it returns many rows I would change or would create another SP. Sometimes especially if unexperienced with Transact SQL, it's best to give more détails about the actual need so that one can suggest what could be done
when starting from 0.
Here this is a minimal amount assuming for example you can't change the SP at all and need to reuse it (and you don't need what it returns ?)