A minor modification to a previously published script - the connection is in autosave mode if there is no active transaction and implicit transactions are disabled:
IF @@TRANCOUNT = 0 AND (@@OPTIONS & 2 = 0) PRINT 'No current transaction, autocommit mode (default)' ELSE IF @@TRANCOUNT = 0 AND (@@OPTIONS & 2 = 2) PRINT 'Implicit transactions is on, no transaction started yet' ELSE IF @@OPTIONS & 2 = 0 PRINT 'Implicit transactions is off, explicit transaction is currently running' ELSE PRINT 'Implicit transactions is on, implicit or explicit transaction is currently running' + CAST(@@OPTIONS & 2 AS VARCHAR(5))
stupid machine
source share