SET
SET changes the default isolation level for the current connection.
Synopsis
Section titled “Synopsis”SET { ISOLATION_LEVEL | ISOLATIONLEVEL | TRANSACTION_ISOLATION } { = | TO } { 'READ COMMITTED' | 'SNAPSHOT' }Description
Section titled “Description”All three variable spellings target the same connection-local isolation setting. Other connections, including handles for the same embedded engine, retain their own defaults.
Parameters
Section titled “Parameters”The value must be a string literal naming READ COMMITTED or SNAPSHOT. Use BEGIN with an explicit isolation level when a per-transaction choice is required.
Result
Section titled “Result”Success returns an empty command result. New transactions without an explicit level use the updated default.
Transaction behavior
Section titled “Transaction behavior”SET changes the default isolation of the current connection only. It does not modify an already active transaction or the defaults of sibling connections.
Errors and limitations
Section titled “Errors and limitations”Unknown variable names and isolation values fail. Changing the default while a transaction is active also fails, so the next transaction has an unambiguous connection-local default.
Privileges
Section titled “Privileges”SET requires an authenticated session with CONNECT but no object privilege.
Example
Section titled “Example”SET ISOLATION_LEVEL = 'READ COMMITTED';BEGIN;ROLLBACK;See also
Section titled “See also”See BEGIN, Transactions and Concurrency and Configuration.