rollback to in sql code example

Example 1: rollback in sql

DELETE clause is from DML,
we can use ROLLBACK to recover the data.
• ROLLBACK —> discharges all pending changes to prev commit
• ROLLBACK TO name —> rolls back changes to savepoint

Example 2: commit in sql

• COMMIT —> making all pending changes permanent;
• SAVEPOINT name —> marks a save point
• ROLLBACK —> discharges all pending changes to prev commit
• ROLLBACK TO name —> rolls back changes to savepoint

Example 3: can we rollback in sql

es, since this DELETE clause is from DML,
we can use ROLLBACK to recover the data.

Example 4: rollback to in sql

• ROLLBACK TO name —> rolls back changes to savepoint

Tags:

Misc Example