UPDATE A SET A.IDANSID = ISNULL(B.STSID, ''), A.IDUPDUSER = 2, A.DTUPDATE = CONVERT(NVARCHAR(10), GETDATE(), 111), A.TMUPDATE = CONVERT(NVARCHAR(8), GETDATE(), 108) FROM JNJT0001 A LEFT JOIN ZRECRPCWJSID B ON B.IDACCOUNT = A.IDLOGIN WHERE A.IDSYSUSER >= 1000