H2 Database - Savepoint

H2 Database - Savepoint

SAVEPOINT is a command used to temporarily save a transaction. It is better to store savepoints in your transaction as it is useful to rollback a transaction to the appropriate savepoint if necessary.

Syntax

Following is the general syntax of the Savepoint command.

SAVEPOINT savepointName

example

In this example, we will create a savepoint named Half_Done using the following command.

SAVEPOINT Half_Done ; 

The above command produces the following output.