Currently I'm updating a database on a local PC and then uploading the complete data to the server.
The table is dropped, and all the data rebuilt via CSV.
I'd like to change that now to just upload changed / new data.
table struc: date, name, city
The way I would check if a record already exists is based on date and name. i.e. there can not be two or more records with the same date and name.
- Read the csv file line by line.
- If date & name already exist then delete and replace
- If date & name do not already exist then insert
What's the best way of doing this?