View Partition Locks with sp_familylock

Use sp_familylock to display the partition locks held by a family.

View locked partitions in the partitionid column of the sp_familylock report.

This example displays the partition locks currently held by a family. The class column displays the cursor name for locks associated with a cursor for the current user and the cursor id for other users.
sp_familylock
go

Fid spid loid locktype table_id partitionid page dbname class context
------ ------ ------ ------------------- --------------- ---------------- -------- ----------- ---------- ------------------------------ 

25 19 50 Sh_cpartition 672002394 -1 0 userdb Non Cursor Lock LOCK CONTEXT VALUES
25 19 50 Sh_partition 672002394 688002451 0 userdb Non Cursor Lock LOCK CONTEXT VALUES 
25 20 50 Sh_cpartition 672002394 -1 0 userdb Non Cursor Lock LOCK CONTEXT VALUES 
25 20 50 Sh_intent_partition 672002394 688002451 0 userdb Non Cursor Lock LOCK CONTEXT VALUES 
25 20 50 Sh_partition 672002394 704002508 0 userdb Non Cursor Lock LOCK CONTEXT VALUES 
25 25 50 Sh_intent 672002394 0 0 userdb Non Cursor Lock LOCK CONTEXT VALUES 

(6 rows affected)
(return status = 0)
Related concepts
sp_familylock