merge

Tips for UPSERT or update using insert in SQL Server

  • Star
  • Star
  • Star
  • Star
  • Star

Merge SQL

In many cases, especially in ETL processes or data loading to a data warehouse, for example, we would rather use a single sentence or the checking of the existence of a register and its updating. If register doesn't exist we would want to insert it. This combination has been nicknamed UPSERT, although in SQL there is a specific statement to make it, which is MERGE.