I\'m trying to implement your basic UPSERT functionality, but with a twist: sometimes I don\'t want to actually update an existing row.
Essentially I\'m trying to synchr
I'd drop the transaction.
Plus the @@rowcount probably would work, but using global variables as a conditional check will lead to bugs.
Just do an Exists() check. You have to make a pass through the table anyhow, so speed is not the issue.
No need for the transaction as far as I can see.