0 votes
1 view
in SQL by (35.7k points)

Can anyone explain rollback in SQL?

1 Answer

0 votes
by (86.2k points)

The ROLLBACK command is a transactional control command used to roll back the changes that are not saved to the database. You have to create a SAVEPOINT before you delete records from the table so that you can roll back to that SAVEPOINT whenever needed.

Here is an example of how you can create SAVEPOINT and how to rollback to that SAVEPOINT:

SAVEPOINT savepoint_1;

DELETE FROM Employee

WHERE E_id = 797;

ROLLBACK to savepoint_1;

You can check out this SQL Tutorial blog to know more about ROLLBACK and how to use ROLLBACK.

Related questions

0 votes
1 answer
asked Aug 16 in SQL by Sudhir_1997 (35.7k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked May 8 in SQL by Sudhir_1997 (35.7k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...