When ON, SET IMPLICIT_TRANSACTIONS sets the connection into implicit transaction mode. When OFF, it returns the connection to autocommit transaction mode.
When a connection is in implicit transaction mode and the connection is not currently in a transaction, executing any of the following statements starts a transaction:
|
ALTER TABLE
|
FETCH
|
REVOKE
|
|
BEGIN TRANSACTION
|
GRANT
|
SELECT
|
|
CREATE
|
INSERT
|
TRUNCATE TABLE
|
|
DELETE
|
OPEN
|
UPDATE
|
|
DROP
|
|
|
If the connection is already in an open transaction, the statements do not start a new transaction.
Transactions that are automatically opened as the result of this setting being ON must be explicitly committed or rolled back by the user at the end of the transaction. Otherwise, the transaction and all of the data changes it contains are rolled back when the user disconnects. After a transaction is committed, executing one of the statements above starts a new transaction.
Implicit transaction mode remains in effect until the connection executes a SET IMPLICIT_TRANSACTIONS OFF statement, which returns the connection to autocommit mode. In autocommit mode, all individual statements are committed if they complete successfully.
The SQL Server Native Client OLE DB Provider for SQL Server and the SQL Server Native Client ODBC driver automatically set IMPLICIT_TRANSACTIONS to OFF when connecting. SET IMPLICIT_TRANSACTIONS defaults to OFF for connections with the SQLClient managed provider, and for SOAP requests received through HTTP endpoints.
When SET ANSI_DEFAULTS is ON, SET IMPLICIT_TRANSACTIONS is ON.
The setting of SET IMPLICIT_TRANSACTIONS is set at execute or run time and not at parse time.