DISCOVER_LOCKS Rowset

DISCOVER_LOCKS Rowset

 

Applies To: SQL Server 2016 Preview

Provides information about the current standing locks on the server.

The DISCOVER_LOCKS rowset contains the following columns.

Column nameType indicatorLengthDescription
LOCK_CREATION_TIMEDBTYPE_DBTIMESTAMPThe UTC server time at the moment lock was requested.
LOCK_GRANT_TIMEDBTYPE_DBTIMESTAMPThe UTC server time at the moment lock was granted on the resource.
LOCK_IDDBTYPE_GUIDThe unique identifier of the lock, as a GUID.
LOCK_OBJECT_IDDBTYPE_WSTRThe unique identifier of object being locked.
LOCK_STATUSDBTYPE_I4The lock status.

0 means "Waiting to lock the object."

1 means "Lock Granted."
LOCK_TRANSACTION_IDDBTYPE_GUIDThe unique identifier of the transaction, as a GUID.
LOCK_TYPEDBTYPE_I4A bit mask of Lock Types; for more information, see the Remarks section of this topic.
SPIDDBTYPE_I4The session ID.

This schema rowset is not sorted.

The DISCOVER_LOCKS rowset can be restricted on the columns listed in the following table.

Column nameType indicatorRestriction State
SPIDDBTYPE_I4Optional.
LOCK_TRANSACTION_IDDBTYPE_GUIDOptional.
LOCK_OBJECT_IDDBTYPE_WSTROptional.
LOCK_STATUSDBTYPE_I4Optional.
LOCK_TYPEDBTYPE_I4Optional.
LOCK_MIN_TOTAL_MSDBTYPE_I8Optional.
Lock NameValueDescription
LOCK_NONE0x0000000No lock.
LOCK_SESSION_LOCK0x0000001Inactive session; does not interfere with other locks.
LOCK_READ0x0000002Read lock during processing.
LOCK_WRITE0x0000004Write lock during processing.
LOCK_COMMIT_READ0x0000008Commit lock, shared.
LOCK_COMMIT_WRITE0x0000010Commit lock, exclusive.
LOCK_COMMIT_ABORTABLE0x0000020Abort at commit progress.
LOCK_COMMIT_INPROGRESS0x0000040Commit in progress.
LOCK_INVALID0x0000080Invalid lock.

XML for Analysis Schema Rowsets

Community Additions

ADD
Show:
© 2016 Microsoft