如何检查SQL Server 2008的另一个连接的隔离级别

时间:2021-08-29 15:55:27

I need to see the isolation level of all the current connections to find some locking issue.

我需要查看所有当前连接的隔离级别以找到一些锁定问题。

I tried DBCC Useroptions but it gives me info only for my user.

我尝试过DBCC Useroptions,但它只为我的用户提供了信息。

I tried DBCC PSS(0) or DBCC PSS(1,57) But I get the following error:

我尝试过DBCC PSS(0)或DBCC PSS(1,57)但是我收到以下错误:

Incorrect DBCC statement. Check the documentation for the correct DBCC syntax and options.

DBCC语句不正确。检查文档以获取正确的DBCC语法和选项。

1 个解决方案

#1


15  

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 
FROM sys.dm_exec_sessions 
WHERE session_id = <spid_of_other_session>

#1


15  

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 
FROM sys.dm_exec_sessions 
WHERE session_id = <spid_of_other_session>