update bd set bd.Dom_ID_Restoration = 788 from Bargeh b join BargehDetail bd on b.ID = bd.Bar_ID where bd.Dom_ID_Noe = 666 and --کالا bd.Dom_ID_Restoration is null