Server.EnumLocks Method (Int32)
Enumerates a list of current locks held by the specified process on the instance of SQL Server.
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
Return ValueType: System.Data.DataTable
The SQL Server process ID that uniquely identifies the process requesting the lock.
The type of lock. See req_mode in sys.syslockinfo (Transact-SQL).
The name of the database that contains the lock.
The schema of the locked resource.
The table that contains the lock.
The index that contains the lock.
The status of the lock. 1 for Grant, 2 for Convert, and 3 for Wait.
Use this method to determine the locks that are currently held on the instance of SQL Server. The information that is returned can help you identify locking problems that might affect performance.