All Tags »
Transact SQL »
Stress Testing »
Defensive programming (RSS)
Sorry, but there are no more tags available to filter with.
-
Neither
UPDATE … IF (@@ROWCOUNT = 0) INSERT
nor
IF EXISTS(...) UPDATE ELSE INSERT
patterns work as expected under high concurrency. Both may fail. Both may fail very frequently. MERGE is the king - it holds up much better.Let us do some stress testing and see for ourselves.
Here is the table we shall be ...