How to Identify Locked Table in SQL Server?
SQL Server is a relational database management system (RDBMS) from Microsoft that’s designed for the enterprise environment. SQL Server runs on T-SQL (Transact -SQL), a set of programming extensions from Sybase and Microsoft that add several features to standard SQL, including transaction control, exception and error handling, row processing, and declared variables.
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.
BEST SQL 2016 HOSTING RECOMMENDATION
ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers SQL 2016 hosting starts from $5. ASPHostPortal also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable SQL 2014 Hosting, ASPHostPortal should be your best choice.