1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Transactions and Error Handling in SQL Server

Connected

अभ्यास

Doomed transactions

You want to insert the data of two new customers into the customer table. You prepare a script controlling that if an error occurs, the transaction rollbacks and you get the message of the error. You want to control it using XACT_ABORT in combination with XACT_STATE.

निर्देश

100 XP
  • Use the appropriate setting of XACT_ABORT.
  • Check if there is an open transaction.
  • Rollback the transaction.
  • Select the error message.