1. Learn
  2. /
  3. Courses
  4. /
  5. Transactions and Error Handling in SQL Server

Connected

Exercise

Using savepoints

Your colleague Anita needs help. She prepared a script that uses savepoints, but it doesn't work. The script marks the first savepoint, savepoint1 and then inserts the data of a customer. Then, the script marks another savepoint, savepoint2, and inserts the data of another customer again. After that, both savepoints are rolled back. Finally, the script marks another savepoint, savepoint3, and inserts the data of another customer.

Anita tells you that her script doesn't work because it has some errors, but she doesn't know how to correct them. Can you help her?

Instructions

100 XP
  • Run the code to verify there are errors.
  • Correct every error.