UPDATE A
SET CompanyCode = b.CompanyCode
FROM A a,B b
where a.TaxNumber=b.TaxNumber
and b.sysno is not null
and a.CompanyCode!=b.CompanyCode
UPDATE A
SET CompanyCode = b.CompanyCode
FROM A a,B b
where a.TaxNumber=b.TaxNumber
and b.sysno is not null
and a.CompanyCode!=b.CompanyCode