• create proc sp_temp

    @count INT = NULL OUTPUT

    as

    begin

    declare @Result varchar(5)

    select @count = COUNT(*) from #temptable

    end

    Try this out