Wednesday, March 28, 2012

relationship between set ansi_defaults and set implicit_transactio

BOL States the following in the SET ANSI_DEFAULTS section:
SQL Server ODBC driver automatically set ANSI_DEFAULTS to ON when
connecting. The driver then set CURSOR_CLOSE_ON_COMMIT and
IMPLICIT_TRANSACTIONS to OFF.
BOL States the following in the SET IMPLICIT_TRANSACTIONS:
When SET ANSI_DEFAULTS is ON, SET IMPLICIT_TRANSACTIONS is enabled.
What does SET IMPLICIT_TRANSACTIONS is enabled mean? If it means SET
IMPLICIT_TRANSACTIONS is ON, is this conflicting with the statment in the SE
T
ANSI_DEFAULTS section. Or the setting ANSI_DEFAULTS affects the setting
IMPLICIT_TRANSACTIONS differently based on the source (driver or sql
statement).ANSI_DEFAULT is just a grouping of other SET options, a way to turn on a num
ber of SET options with
one command. Seems like ODBC first turn on ANSI_DEFAULT and then turn off IM
PLICIT_TRANSACTIONS.
This is doable, "turn on all which are in ANSI_DEFAULT but I don't want IMPL
ICIT_TRANSACTIOPNS so I
turn that off explicitly":
DBCC USEROPTIONS
SET ANSI_DEFAULTS ON
GO
DBCC USEROPTIONS
SET IMPLICIT_TRANSACTIONS OFF
GO
DBCC USEROPTIONS
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:AF6843DA-18C9-4980-A25E-55D9FAE003E6@.microsoft.com...
> BOL States the following in the SET ANSI_DEFAULTS section:
> SQL Server ODBC driver automatically set ANSI_DEFAULTS to ON when
> connecting. The driver then set CURSOR_CLOSE_ON_COMMIT and
> IMPLICIT_TRANSACTIONS to OFF.
>
> BOL States the following in the SET IMPLICIT_TRANSACTIONS:
> When SET ANSI_DEFAULTS is ON, SET IMPLICIT_TRANSACTIONS is enabled.
>
> What does SET IMPLICIT_TRANSACTIONS is enabled mean? If it means SET
> IMPLICIT_TRANSACTIONS is ON, is this conflicting with the statment in the
SET
> ANSI_DEFAULTS section. Or the setting ANSI_DEFAULTS affects the setting
> IMPLICIT_TRANSACTIONS differently based on the source (driver or sql
> statement).

No comments:

Post a Comment