SQLTeam.com | Weblogs | Forums

Using Conditional loops from the results of a stored procedures


I want to run a stored procedure and if it returns counts (which is what it does), I want to run another stored procedure if not I just want it to return a message that there are not results today. I know that I would run a SQL task to start store the results in a variable, and that I would need a conditional loop but I am not sure how to connect these and all that I would need here.
Does someone have an example or know where I can go to get one.


create proc proc1
set nocount on;

declare @count int;

select @count = count(*) from table1;

if @count > 1
exec proc2;
select 'No results today.';


That works, Thanks
I was hoping to see how to do this part in SSIS though, but that will work.
Thank you