UPDATE spt
SET spt.SPTRUseID = ap.PAR_Valor
    FROM TESISSEG.dbo.SchPrgTrig spt
LEFT JOIN TESISSEG.dbo.AS_PARAMETROS ap ON ap.PAR_Parametro  = 'USUARIO_WEB_CLIENTE_TESIS' AND ap.EmpID = spt.EmpID
    LEFT JOIN TESISSEG.dbo.Usuarios u ON u.UseID = spt.SPTRUseID
    LEFT JOIN TESISSEG.dbo.UsuParCor upc ON upc.UseID = u.UseID AND spt.EmpID = upc.EmpID
WHERE u.UseID IS NULL AND upc.UseID IS NULL
  AND ap.PAR_Valor IS NOT NULL
  AND ap.PAR_Oficina_tesis IS NULL