Back
How do you find current database's transaction level on SQL Server?
Use this code:
SELECT CASE transaction_isolation_level1 WHEN 0 THEN 'Unspecified' WHEN 1 THEN 'Read_Uncommitted' WHEN 2 THEN 'Read_Committed' WHEN 3 THEN 'Repeatable' WHEN 4 THEN 'Serializable' WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL1FROM sys.dm_exec_sessions where session_id = @@SPID
SELECT CASE transaction_isolation_level1
WHEN 0 THEN 'Unspecified'
WHEN 1 THEN 'Read_Uncommitted'
WHEN 2 THEN 'Read_Committed'
WHEN 3 THEN 'Repeatable'
WHEN 4 THEN 'Serializable'
WHEN 5 THEN 'Snapshot' END AS TRANSACTION_ISOLATION_LEVEL1
FROM sys.dm_exec_sessions
where session_id = @@SPID
Head over to this video, if you want to learn Transaction in SQL.
Refer to this: docs.microsoft.com reference for the constant values.
31k questions
32.8k answers
501 comments
693 users