Hello,

How can I pass the value of the count(*) to outside the execute. I need the value to continue with the sp

set @sql= 'declare @res int select @res=count(*) from t
where tam=(select '+@posxx+' from sffpoxx0 where ponbr='+@Col001+' and poodn='+@Col002+' and pocat='+@Col007+')'

???????? set @result=exec (@sql) ????????????? Something like this


Thanks
Paulo