You need to return the value from Determine_Class using RETURN statement as below:Create procedure Determine_Class(@Wt int,@Cf decimal(7,2))asdeclare @Density decimal(7,2)declare @Class intset @Density = @Wt / @Cfif @Density >= 35.01set @Class = 50else if @Density >= 30.01set @Class = 55else if @Density >= 22set @Class = 60elseset @Class = 100Select @Class as ClassRETURN @Classgo
Then you can access the value from calling proc as below:exec @Class = Determine_Class(10, 5)
Harsh Athalyehttp://www.letsgeek.net/