How to find current transaction level?

dance2die picture dance2die · Jun 24, 2009 · Viewed 127.1k times · Source

How do you find current database's transaction level on SQL Server?

Answer

SQLMenace picture SQLMenace · Jun 24, 2009

Run this:

SELECT CASE transaction_isolation_level 
WHEN 0 THEN 'Unspecified' 
WHEN 1 THEN 'ReadUncommitted' 
WHEN 2 THEN 'ReadCommitted' 
WHEN 3 THEN 'Repeatable' 
WHEN 4 THEN 'Serializable' 
WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL 
FROM sys.dm_exec_sessions 
where session_id = @@SPID

docs.microsoft.com reference for the constant values.