In both cases there is possoble to use
EXISTS[
^] statement, which specifies a subquery to test for the existence of rows.
Insert scenario:
INSERT INTO TableName (Field1, Field2, ..., FieldN)
SELECT Field1, Field2, ..., FieldN
FROM TableName AS t1
WHERE NOT EXISTS (
SELECT Field1, Field2, ..., FieldN
FROM OtherTableName AS t2
WHERE t1.ID = t2.ID
)
The same is possible to achieve using
IN clause[
^].
Update scenario:
UPDATE t1
SET t1.Field1 = t2.Field1,
t1.Field2 = t2.Field2
FROM TableName AS t1 INNER JOIN OtherTableName AS t2 ON t1.ID = t2.ID
This is a general conception... Change it to your needs.