upsert with addition
- by cf_PhillipSenn
How would you write the following in Microsoft SQL Server 2008?
IF EXISTS(SELECT * FROM Table WHERE Something=1000)
UPDATE Table SET Qty = Qty + 1 WHERE Something=1000
ELSE
INSERT INTO Table(Something,Qty) VALUES(1000,1)