Learn preventing overbooking through a last-seat race, an atomic update, update locks, and a database constraint that rejects oversold inventory.
SQL SERVER – Interesting Observation of DMV of Active Transactions and DMV of Current Transactions
sys.dm_tran_active_transactions and sys.dm_tran_current_transaction look alike, but one lists active transactions for the instance, the other only your session.
Updating a Large Table in Batches With a Moving Key Range
Walk the clustered key a slice at a time, log each batch, and learn why stopping at the first empty batch quietly leaves rows behind.
SQL SERVER – Transaction and Local Variables – Swap Variables – Update All At Once Concept
Two ideas with examples: transactions have no effect on local variables, and an UPDATE applies all its changes at once, which lets you Swap Variables in one go.







