Definition – What is SQL Transaction?
- SQL Transaction is a single unit of work applied on a database.
- Its a sequence of operations perfomed on database in an logical order.
- The SQL statements of an transaction will be either commited or rolled back.
- Transaction comprises with two results, they are either Success or Failure.
SQL Transaction Properties
Typically transactions have four standard properties and they are abreviated as ‘ACID’
Transactions are aborted at point of failure, by this way it ensure the operations of work units were completed successfully.
Upon a successsful commited transcation, it will ensure the database state is changed.
Transactions will operate independently and transparently.
In case of system failure, it ensures the result of commited Transaction is persist.
Following are the commands used to control the transactions.
This command will save the changes.
This command will roll back(undo ro revert) the changes.
This command creates save points for the groups of transactions that has to be ROLLBACK.
SET TRANSACTION :
Sets a name on a transaction.
SET TRANSACTION [ READ ONLY | READ WRITE];
Read SQL Guide