• Koen's nailed all the good reasons for not persisting this information. It's easy enough to calculate on the fly:

    -- This running total uses a triangular join.

    -- The performance of TJ's usually sucks. Depending

    -- on the maximum number of rows which are

    -- aggregated when month = 12, you may have to change

    -- this part of the query to a running totals rCTE

    -- or a Quirky Update

    ;WITH RunningTotals AS (

    SELECT t1.cod, t1.year, t1.month, [value] = x.value

    FROM Table_1 t1

    CROSS APPLY (

    SELECT value = SUM(value)

    FROM Table_1 t2

    WHERE t2.cod = t1.cod

    AND t2.year = t1.year

    AND t2.month <= t1.month) x

    ),

    -- construct a matrix containing all cod/year/month values

    AllCodPeriods AS (

    SELECT

    AllCods.cod,

    AllYears.year,

    AllMonths.month

    FROM (SELECT month FROM RunningTotals GROUP BY month) AllMonths

    CROSS JOIN (SELECT year FROM RunningTotals GROUP BY year) AllYears

    CROSS JOIN (SELECT cod FROM RunningTotals GROUP BY cod) AllCods

    )

    SELECT

    matrix.cod,

    matrix.year,

    matrix.month,

    ty.value,

    [value pp] = ly.value

    FROM AllCodPeriods matrix

    LEFT JOIN RunningTotals ty

    ON ty.cod = matrix.cod

    AND ty.year = matrix.year

    AND ty.month = matrix.month

    LEFT JOIN RunningTotals ly

    ON ly.cod = matrix.cod

    AND ly.year+1 = matrix.year

    AND ly.month = matrix.month

    -- here's an alternative using APPLY, which carries down

    -- the running total from 2012/2 to 2012/3.

    SELECT

    AllCods.cod,

    AllYears.year,

    AllMonths.month,

    ty.Value,

    [value pp] = ly.value

    FROM (SELECT month FROM Table_1 GROUP BY month) AllMonths

    CROSS JOIN (SELECT year FROM Table_1 GROUP BY year) AllYears

    CROSS JOIN (SELECT cod FROM Table_1 GROUP BY cod) AllCods

    OUTER APPLY (

    SELECT value = SUM(value)

    FROM Table_1 t2

    WHERE t2.cod = AllCods.cod

    AND t2.year = AllYears.year

    AND t2.month <= AllMonths.month

    ) ty

    OUTER APPLY (

    SELECT value = SUM(value)

    FROM Table_1 t2

    WHERE t2.cod = AllCods.cod

    AND t2.year+1 = AllYears.year

    AND t2.month <= AllMonths.month

    ) ly

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden