﻿update T_ORARENDIORA
set
	C_CSENGETESIRENDID = (select C_CSENGETESIRENDID from T_CSENGETESIRENDORA where ID = C_CSENGETESIRENDORAID),
	LASTCHANGED = GETDATE()
where
	C_CSENGETESIRENDORAID is not null and C_CSENGETESIRENDID is null and TOROLT = 'F'