UPDATE VS4TAPVDocRef SET TPVRRefWtaxTotal=isnull((SELECT TIAPWtaxTotal FROM VS4TAPInvoice WHERE VS4TAPInvoice.TIAPNo=VS4TAPVDocRef.TPVRRefDocNo),0)
WHERE TPVRRefWtaxTotal=0 or TPVRRefWtaxTotal is null
GO
