Diagnose SQL Server performance issues using sp_lock
Posted April 1st, 2008 by Andrew PopoffA common misconception among IT pros is that “locks are bad,” and you must do everything possible to ensure database locking doesn’t prevent processes from running. In order to ensure a consistent database environment, the database engine must use a mechanism to acquire exclusive use of a resource when that resource is being modified.
SQL Server uses locks to achieve this consistency. Locks are objects that the database engine uses to ensure that only one thread can access a resource at a time. Without the use of locks, concurrent data modifications would be possible by separate processes, which could potentially leave the database in an inconsistent state. Locks are a good thing, but you should plan your applications in such a way to minimize the number of database locks involved.
Here are details about a stored procedure that enables you to diagnose your database locking issues.
PS
I’m using MSSQL Blocks .
Tags: sp_lock |
Leave a Reply