From the course: SQL Queries Made Easy

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Rollback in database changes

Rollback in database changes - SQL Tutorial

From the course: SQL Queries Made Easy

Start my 1-month free trial

Rollback in database changes

- [Narrator] In this video, we learned about two other transaction control statements, namely rollback and savepoint. They both work together. Rollback discard all pending data changes and ends the current transaction. Savepoint creates a marker point within a transaction. By using commit and rollback we can preview the data changes before making them permanent. AutoRollback occurs when there is a system failure or abnormal termination of the system. Now, let's understand by taking an example. Here, I have issued a commit to save all the pending changes that have been executed before this commit statement. Now, I start a new transaction. A new transaction begins when I execute the first DML statement. So, once I execute this insert statement, a new transaction has started. Now, after the insert statement, I've given an update statement, then I have written earth savepoint to create a marker point in this transaction.…

Contents