update TableA set id=TableB.id from TableA,TableB where TableA.name=TableB.name
05-11 13:28