Why isn't SET XACT_ABORT ON the default behavior?
Asked Answered
T

1

24

Reading things like this post on Dan Guzman's blog, I wonder: why isn't SET XACT_ABORT ON the default behavior? Is there a case where it's harmful, or much less desirable/efficient than SET XACT_ABORT OFF?

Transformation answered 31/10, 2011 at 16:51 Comment(5)
Funny, I just came across similar info and had the same question - "what am I missing, why would you want it to be this way by default?"Dibbrun
RelatedHomburg
Related...but a very different question.Transformation
See stackoverflow.com/… pleaseBlanchard
agreed. there should be an option in the SSMS Advanced Execution Query Options window (along with 'SET NOCOUNT", "SET ARITHABORT", etc...) and that option should get copied to new SPs (in the same way that "ANSI_NULLS" and "QUOTED_IDENTIFIER" are)Footboy
B
16

It's an automatic response to an error, it's more desirable if you can handle the error and recover from it. If the transaction automatically rolls back then you don't get this opportunity.

The problem Dan mentions in his blog arises because of the abort from the client, within SQL this abort doesn't exist. Hence within SQL the default is not to automatically abort transactions.

Bignoniaceous answered 23/11, 2011 at 19:50 Comment(1)
Also see this related question.Inextinguishable

© 2022 - 2024 — McMap. All rights reserved.