Transactions

Transactions#

A transaction groups a set of statements so that they either all take effect or none do. Querona supports explicit transactions with BEGIN TRANSACTION, COMMIT and ROLLBACK.

BEGIN TRANSACTION#

Starts a new transaction.

BEGIN TRANSACTION TRAN name WITH MARK description

COMMIT#

Makes the changes made in the current transaction permanent.

COMMIT TRANSACTION TRAN name WORK

ROLLBACK#

Discards the changes made in the current transaction.

ROLLBACK TRANSACTION TRAN name

Example#

BEGIN TRANSACTION;
    UPDATE dbo.Account SET Balance = Balance - 100 WHERE Id = 1;
    UPDATE dbo.Account SET Balance = Balance + 100 WHERE Id = 2;
COMMIT;