Find out number of active locks on a table I was wondering if there is a way to find out the number of active locks held on a table in SQL Server?
Here is a start. Remember that locks can go parallel so you may see the same object being locked on multiple resource_lock_partition values.

USE yourdatabase;
GO

SELECT * FROM sys.dm_tran_locks
  WHERE resource_database_id = DB_ID()
  AND resource_associated_entity_id = OBJECT_ID(N'dbo.yourtablename');


Please look at the documentation for sys.dm_tran_locks