Example (standard-style syntax). Verify supported keywords in your database.
BEGIN; UPDATE accounts SET balance = balance - 25 WHERE id = 1;Begin an explicit transaction; exact keywords vary by database.
BEGIN [TRANSACTION];Example (standard-style syntax). Verify supported keywords in your database.
BEGIN; UPDATE accounts SET balance = balance - 25 WHERE id = 1;SQLite-oriented variant; dialect behaviour may differ.
START TRANSACTION; UPDATE accounts SET balance = balance - 25 WHERE id = 1;| Option / clause | Description |
|---|---|
BEGIN / START TRANSACTION | Start a transaction; exact keywords vary by engine. |
COMMIT | Make the transaction's changes permanent. |
ROLLBACK | Undo uncommitted work or return to a savepoint. |
SAVEPOINT | Mark an intermediate point within a transaction. |
Isolation level | Choose concurrency behaviour where supported. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.