Help Center > > Developer Guide> SQL Reference> SQL Syntax> ROLLBACK

ROLLBACK

Updated at: Mar 13, 2020 GMT+08:00

Function

Rolls back the current transaction and backs out all updates in the transaction.

ROLLBACK backs out of all changes that a transaction makes to a database if the transaction fails to be executed due to a fault.

Precautions

If a ROLLBACK statement is executed out of a transaction, no error occurs, but a warning information is displayed.

Syntax

ROLLBACK [ WORK | TRANSACTION ];

Parameter Description

WORK | TRANSACTION

Optional keyword that more clearly illustrates the syntax.

Examples

1
2
3
4
5
-- Start a transaction:
START TRANSACTION;

-- Back out all changes:
ROLLBACK;

Helpful Links

COMMIT | END

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel