Developing SQL Databases — Question 145

You have multiple stored procedures inside a transaction.
You need to ensure that all the data modified by the transaction is rolled back if a stored procedure causes a deadlock or times out.
What should you do?

Answer options

Correct answer: F

Explanation

Setting SET XACT_ABORT to ON ensures that if a stored procedure encounters an error, the entire transaction is aborted and rolled back, preventing partial updates. The other options do not provide the same level of control over transaction handling during deadlocks or timeouts.