다음을 통해 공유


EnumLocks Method

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The EnumLocks method returns a QueryResults object that enumerates the resource locks held by an instance of Microsoft SQL Server.

구문

object
.EnumLocks( [ Who ] )as QueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Who
    Optionally restricts output by process identifier.

Prototype (C/C++)

HRESULT EnumLocks(
LPSQLDMOQUERYRESULTS* ppResults,
long Who = -1);

Returns

A QueryResults object that contains one result set defined by these columns.

Column Data type Description

dbname

nvarchar(129)

Name of the database in which the locked resource is defined.

indexname

nvarchar(129)

If applicable, the name of the index against which the lock is applied.

locktype

nvarchar(36)

A text description of a locking mode. For more information about interpreting values, see the description of the system table syslockinfo column req_mode.

req_spid

integer

Process ID of the process requesting the lock.

status

tinyint

An integer indicating lock application status. For more information about interpreting values, see the description of the system table syslockinfo column req_status.

tablename

nvarchar(129)

If applicable, the name of the table against which the lock is applied.

주의

When restricting the QueryResults object content using the Who argument, use the process ID that identifies the login or other process targeted. The EnumProcesses method can help identify a target process.

Applies To:

Database Object

SQLServer Object

참고 항목

참조

EnumProcesses Method

관련 자료

sys.syslockinfo(Transact-SQL)

도움말 및 정보

SQL Server 2005 지원 받기