This is probably very simple to fix, but it's got me baffled. Here is the stored procedure and I just need to return one numberALTER PROCEDURE [dbo].[RDusp_Report_HeatMapHighLikeHighImpact] -- Add the parameters for the stored procedure here @SiteID int, @RiskCount int output, ASBEGIN SET NOCOUNT ON; -- Insert statements for procedure here select sum(cnt) as mytotal from(select count(Impact.Rating) as cnt from Impact, Likelihood, Exposure where Impact.SiteID=2and Exposure.SiteID = 2 and Impact.Rating > 3 and Likelihood.Rating > 3and Exposure.ImpactID = Impact.ImpactID and exposure.LikelihoodID = Likelihood.LikelihoodID) as cEND
The value in mytotal I want to return as @RiskCount. But I get errors whenever I try to set @RiskCount = mytotal. Any ideas?