﻿--Migration
UPDATE ic
  SET ic.C_ERTEK = 'true'
    ,ic.LASTCHANGED = GETDATE()
    ,ic.MODIFIER = 0
    ,ic.SERIAL = ic.SERIAL + 1
  FROM T_INTEZMENYCONFIG_OSSZES ic
    INNER JOIN T_INTEZMENY_OSSZES i on i.ID = ic.C_INTEZMENYID AND i.TOROLT = 'F'
    INNER JOIN T_TANEV_OSSZES tv on tv.C_INTEZMENYID = i.ID AND tv.C_AKTIV = 'T' AND tv.C_NEV = '2021/2022' AND tv.TOROLT = 'F'
    INNER JOIN T_INTEZMENYADATOK_OSSZES ia on ia.C_TANEVID = tv.ID AND ia.TOROLT = 'F'
  WHERE ic.C_CONFIGTIPUSID = 19
    AND ic.TOROLT = 'F'
    AND ia.C_ISSZAKKEPZO = 'T'
    AND ic.C_ERTEK <> 'true'
