update certain fields only when there is a value related to that field
makes me think you really want to do this:
UPDATE a
SET ResultType1 = CASE WHEN b.[Type] = 'type1'
THEN b.value
ELSE ResultType1
END
, ResultType2 = CASE WHEN b.[Type] = 'type2'
THEN b.value
ELSE ResultType2
END
FROM tableA AS a
INNER JOIN tableB AS b ON a.ID = b.ID
So, ResultType1 / 2 will be set to their existing values, if the b.Type conditions are not met, INSTEAD is NULL.
, " ", , NULL.
, , - ELSE NULL CASE.
ResultType1 ResultType2 , , 'type', :
UPDATE a
SET ResultType1 = CASE WHEN b.[Type] = 'type1'
THEN b.value
ELSE NULL
END
, ResultType2 = CASE WHEN b.[Type] = 'type2'
THEN b.value
ELSE NULL
END
FROM tableA AS a
INNER JOIN tableB AS b ON a.ID = b.ID
WHERE b.[Type] IN ('type1', 'type2')