SELECT '0001' ID ,100 FSUM INTO #TB
SELECT '0001' ID ,100 FM1,O FM2 INTO #T
UNION ALL
SELECT '0001' ID ,0 FM1,100 FM2
SELECT A.ID,A.FSUM,B.FM1,B.FM2 FROM #TB A,#T B WHERE A.ID=B.ID
UPDATE #TB SET FSUM=A.FSUM+B.FM1-B.FM2 FROM #TB A,#T B WHERE A.ID=B.ID