Implicit vs Explicit Transaction
Implicit vs Explicit Transaction is a SQL statement in the Transactions category. SQL Server: implicit mode auto-starts a transaction for each DML but requires explicit COMMIT/ROLLBACK. The syntax is SET IMPLICIT_TRANSACTIONS ON;. It returns transaction mode set. A typical example: SET IMPLICIT_TRANSACTIONS ON; UPDATE employees SET salary = salary * 1.1 WHERE department = 'IT'; -- Transaction is auto-started -- NO auto-commit! Need explicit COMMIT COMMIT; -- Permanently save -- Compare: -- Autocommit (default): each statement is its own transaction -- Explicit (BEGIN/COMMIT): manual start and end -- Implicit: auto-start, manual end A close relative is BEGIN / START TRANSACTION, which begins a new transaction. Changes made within are invisible to others until COMMIT. A close relative is COMMIT, which saves all changes made in the current transaction permanently. A close relative is ROLLBACK, which undoes all changes made in the current transaction (or to a savepoint).