Try using the merge command. you tell it how to handle conflicts. If a record does not exist there is an insert clause, if a record does exist there is an update clause, etc.