Close

SQL Server Upsert

In SQL Server it often happens that you want to either insert or update a table row. You could first check the row count via select statement. Or you could check the @error variable after update. Nothing wrong, but wouldn’t it be convenient (and more performant) to do all of this in one statement. You…