• You can use an output parameter to get the result

    create proc sp_temp

    @count INT OUTPUT = NULL

    as

    begin

    declare @Result varchar(5)

    select @count = COUNT(*) from #temptable

    end

    Now your @count variable will have the count result