I have table A that contains about 10 millions rows and Table B which contains some updated information for some rows in table A and also contains new rows that don't exist in table A.
I want to update table A using table B and at the same time insert rows that have no match in tableA.
I found many answers like the solution below but it seems like they all miss the inserting part that I'm looking for.
UPDATE A
SET code = B.code
FROM B
WHERE A.id = B.id
updateand aninsert.