Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

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

1 Answer

0 votes
by (40.7k points)

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_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.

Browse Categories

...