SQL Server › Transactions & ACID
What does ACID stand for, and what does each letter represent in the context of database transactions?
BeginnerAnswer
ACID stands for Atomicity, meaning a transaction fully succeeds or fully fails with nothing in between, Consistency, meaning a transaction always leaves the database in a valid state, Isolation, meaning concurrent transactions do not interfere with each other in unexpected ways, and Durability, meaning once a transaction is committed, its changes are permanently saved even if the system crashes immediately afterward.
-- A properly committed transaction guarantees all four ACID properties
BEGIN TRANSACTION;
UPDATE Inventory SET Quantity = Quantity - 1 WHERE ProductId = 5;
COMMIT TRANSACTION; -- durably saved once committedReal-world example A payment processing system relies on all four ACID properties together, ensuring that a completed payment transaction is fully applied, leaves account balances valid, does not interfere with other simultaneous payments, and survives even a sudden server crash immediately after committing.