Here is a quick script which will help users to identify locked tables in the SQL Server.
OBJECT_NAME(p.OBJECT_ID) AS TableName,
JOIN sys.partitions p ON l.resource_associated_entity_id = p.hobt_id
When you run above script, it will display table name and lock on it.
I have written code to lock the person table in the database. After locking the database, when I ran above script – it gave us following resultset.
Reference: Pinal Dave (https://blog.sqlauthority.com)