Home » Posts tagged 'transaction'

Tag Archives: transaction

How to find current/particular transaction level?


There is 2 ways of finding current / particular transaction level :-

1)

SELECT CASE transaction_isolation_level

WHEN 0 THEN ‘Unspecified’

WHEN 1 THEN ‘ReadUncomitted’

WHEN 2 THEN ‘Readcomitted’

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

2)

DECLARE @UserOptions TABLE(SetOption varchar(100), Value varchar(100))

DECLARE @IsolationLevel varchar(100)

INSERT @UserOptions

EXEC(‘DBCC USEROPTIONS WITH NO_INFOMSGS’)

SELECT @IsolationLevel = Value

FROM @UserOptions

WHERE SetOption = ‘isolation level’

 

If you liked this post, do like on Facebook at http://www.facebook.com/mssqlfun

Reference : Rohit Garg (http://mssqlfun.com/)

Advertisements