I am looking for a solution to perform insertion in a duplicate key, for example, as an operation in SQL Server 2005. This operation can insert or update a large number of records. SQL Server 2008 has a neat MERGE operation that will do it perfectly, the problem is that we are stuck with SQL Server 2005.
I looked at standard solutions, but all of them are not very good, because they assume that only one record is updated. Does anyone know a way to replicate MERGE behavior in older versions of SQL Server?
source share