What is the scope of XACT_ABORT

What is the scope of the SET XACT_ABORT statement in SQL Server 2005? i.e.: block, procedure or trigger, connection, database, server?

+8
scope sql-server-2005 xact-abort
source share
2 answers

Technet Using parameters in SQL Server indicates that all SET parameters are bound to a connection or batch layer.

The MSDN SET Statement adds the details:

If the SET statement is executed in a stored procedure or trigger, the value of the SET parameter is restored after the control returns from the stored procedure or trigger. In addition, if the SET statement is specified in a dynamic SQL string that is started using sp_executesql or EXECUTE, the value of the SET parameter is restored after control is returned from the package specified in the dynamic SQL string.

It is also possible to enable XACT_ABORT by default for all users through user parameters :

EXEC sp_configure 'user options', 16384 RECONFIGURE WITH OVERRIDE 

It can also be applied to selected users only through a user login trigger .

See also important information about the behavior of XACT_ABORT .

+3
source share

I think this article from BOL answers your question: SET (Transact-SQL)

-2
source share

All Articles