CHAINED TRANSACTION
CHAINED TRANSACTION is a SQL statement in the Transactions category. SQL standard: commits the current transaction and immediately starts a new one with the same settings. The syntax is COMMIT AND CHAIN;. It returns committed + new transaction started. A typical example: START TRANSACTION; INSERT INTO log VALUES ('step 1'); COMMIT AND CHAIN; -- Prior transaction committed, new one starts immediately INSERT INTO log VALUES ('step 2'); COMMIT; 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). More about this category: Transaction control — BEGIN, COMMIT, ROLLBACK, SAVEPOINT, ACID properties. Related Transactions entries: BEGIN / START TRANSACTION, COMMIT, ROLLBACK, SAVEPOINT, SET TRANSACTION / ISOLATION LEVEL, AUTOCOMMIT, DEADLOCK, XACT_ABORT.