sys.dm_tran_locks
transactions #transactions#dmv
Description
Analytics Platform System (PDW) SQL database in Microsoft Fabric Returns information about currently active lock manager resources in SQL Server. Each row represents a currently active request to the lock manager for a lock that has been granted or is The columns in the result set are divided into two main groups: resource and request. The resource group describes the resource on which the lock request is being made, and the request
Syntax
sys.dm_pdw_nodes_tran_locks
Examples
Example 1
sp_getapplock
Example 2
sys.dm_tran_locks
Example 3
sp_lock
Example 4
Form1
Example 5
AdventureWorks2025
Example 6
dbo
Example 7
BEGIN
ROLLBACK
;
END
ELSE
BEGIN
EXECUTE
@
result
= sp_releaseapplock
@
Resource
=
'Form1'
;
COMMIT
TRANSACTION
;
END
GO
Example 8
USE
AdventureWorks2025;
GO
BEGIN
TRANSACTION
;
DECLARE
@
result
AS
INT
;
EXECUTE
@
result
= sp_getapplock
@
Resource
=
'Form1'
,
@LockMode =
'Shared'
;
COMMIT
TRANSACTION
;
GO