﻿update up
set 
   up.C_TANEVID = f.C_TANEVID
  ,up.LASTCHANGED = GETDATE()
  ,up.SERIAL += 1
  ,up.MODIFIER = 0
from T_USERPROFILE up
inner join T_FELHASZNALO f on up.C_FELHASZNALOID = f.ID and f.TOROLT = 'F'
where up.TOROLT = 'F' and up.C_TANEVID != f.C_TANEVID