UPDATE table1 SET
field1 = CASE WHEN ISNULL(i.field1,'')='' THEN t.field1 ELSE i.field1 END
FROM table1 t INNER JOIN inserted i on t.ID=i.ID
INSERT INTO table1 (ID,field1)
SELECT ID,field1 FROM inserted i WHERE NOT EXISTS (SELECT TOP 1 ID FROM table1 t WHERE t.id = i.id)