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.