SELECT
L.request_session_id AS SessionID,
DB_NAME(L.resource_database_id) AS DatabaseName,
O.Name AS LockedObjectName,
P.object_id AS ObjectID,
L.resource_type AS ResourceType,
L.request_mode AS LockType,
ST.text AS SqlStatementText,
ES.login_name AS LoginName,
ES.host_name AS HostName
FROM sys.dm_tran_locks L
JOIN sys.partitions P ON P.hobt_id = L.resource_associated_entity_id
JOIN sys.objects O ON O.object_id = P.object_id
LEFT JOIN sys.dm_exec_sessions ES ON ES.session_id = L.request_session_id
LEFT JOIN sys.dm_exec_requests ER ON ER.session_id = L.request_session_id
CROSS APPLY sys.dm_exec_sql_text(ER.sql_handle) ST
WHERE resource_database_id = DB_ID()
--and O.Name='BillNOPre'