Небольшое изменение ранее размещенного скрипта - соединение находится в режиме автоматической фиксации, если нет активной транзакции И неявные транзакции отключены:
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))