This is a very basic question but I hope it is not a problem that I ask.
I am developing an interface that will update a database from another database. The two databases are for applications we did not develop.
For each input record, it is not known whether a record needs to be created in the other database. I am interested in knowing if there is much difference in whether we:
(1) first do a query to determine if the record exists, then do either an insert or an update
(2) do an update first and if the record does not exist then do an insert
One advantage to doing the query first is that we can determine when the data has actually changed. Are there any other significant advantages or disadvantages?
For what it is worth, the output database is an Access database; the input database is a SQL Server database but could be another database format such as dbase.