0 votes
1 view
in SQL by (20.3k points)

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

1 Answer

0 votes
by (40.3k 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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...