Sql server lock table while updating

Rated 3.98/5 based on 591 customer reviews

They say that the performance of the application running on top of SQL Server runs slower when the statistics are being updated, but there may be other reasons that may degrade performance like the intense disk activity produced when updating statistics.In this tip, we will cover a scenario where we update statistics while the database is being used to see if blocking does occur during the statistics update.

Some people say that a statistics update blocks transactional activity.Notice that your session_id most likely will be different than the one in the following query.USE master GO SELECT resource_type , resource_subtype , resource_description , resource_associated_entity_id , request_mode , request_type , request_status , request_session_id FROM sys.dm_tran_locks WHERE request_session_id = 79 Represents a subtype of resource_type.The second batch, running in the default transaction isolation level of will return only after a commit or rollback has been completed in the first session.From here you can look at your query plans and the associated lock levels, but better yet, you can read all about locks in SQL Server here.

Leave a Reply