CREATE PROCEDURE sp_Api5_venPeriodoRead
    @year INT,
   @currentMonthValue INT OUTPUT
AS
BEGIN
    DECLARE @currentMonth INT = MONTH(GETDATE())
    SET @currentMonthValue = 0

    SELECT 
        @currentMonthValue = 
            CASE @currentMonth
                WHEN 1 THEN mes01
                WHEN 2 THEN mes02
                WHEN 3 THEN mes03
                WHEN 4 THEN mes04
                WHEN 5 THEN mes05
                WHEN 6 THEN mes06
                WHEN 7 THEN mes07
                WHEN 8 THEN mes08
                WHEN 9 THEN mes09
                WHEN 10 THEN mes10
                WHEN 11 THEN mes11
                WHEN 12 THEN mes12
            END
    FROM VenPeriodos WHERE aņo = @year
END