Complete the code to start a transaction in SQL.
BEGIN [1];To start a transaction in SQL, you use BEGIN TRANSACTION. This marks the start of a transaction block.
Complete the code to save a transaction permanently.
[1];The COMMIT command saves all changes made during the transaction permanently to the database.
Fix the error in the code to undo changes in a transaction.
[1] TRANSACTION;The ROLLBACK command undoes all changes made in the current transaction, reverting the database to its previous state.
Fill both blanks to create a savepoint and rollback to it.
SAVEPOINT [1]; ROLLBACK TO [2];
A savepoint is named (e.g., sp1) and you can rollback to that exact point using ROLLBACK TO sp1.
Fill all three blanks to start a transaction, create a savepoint, and rollback to it.
BEGIN [1]; SAVEPOINT [2]; ROLLBACK TO [3];
First, start the transaction with BEGIN TRANSACTION. Then create a savepoint named sp_save. Finally, rollback to that savepoint with ROLLBACK TO sp_save.