﻿UPDATE alk  
  SET  alk.C_ISDUALISKEPZOHELYIOKTATO = 'T'
      ,alk.LASTCHANGED = GETDATE()
      ,alk.MODIFIER = 0
FROM T_ALKALMAZOTT alk
  INNER JOIN V_ENTITYHISTORY ent ON ent.C_ENTITYID = alk.ID
  INNER JOIN T_INTEZMENYADATOK intAdatok ON intAdatok.ID = alk.C_ALINTEZMENYID ANd intAdatok.TOROLT = 'F'
  INNER JOIN T_TANEV tanev ON tanev.ID = alk.C_ALTANEVID  AND tanev.TOROLT = 'F'
WHERE 
    C_ENTITYNAME = 'T_FELHASZNALO'
AND C_REASON = 'New'
AND C_PROPERTYNAME = 'C_ELOTAG'
AND C_CURRENTVALUE like '[[]DK %'
AND tanev.C_NEV = '2020/2021'
AND intAdatok.C_ISSZAKKEPZO = 'T'
AND alk.C_ISDUALISKEPZOHELYIOKTATO = 'F'