How to check the value of IMPLICIT_TRANSACTION in SQL Server

Viewed 2027

I'm trying to learn about transactions, but I don't know how to check if I've been working with IMPLICIT_TRANSACTIONS on or off.

Is this set to OFF by default, and how do I check what the current value is?

1 Answers

Set implicit transaction on/off

SET IMPLICIT_TRANSACTIONS OFF/ON

Get if implicit transaction on or off

select IIF(@@OPTIONS & 2 = 0, 'OFF', 'ON')

By default it is OFF.

Related