SQL Administrator Question:

Tell us what Is The Difference Between Lock, Block And Deadlock?

Tweet Share WhatsApp

Answer:

Lock: DB engine locks the rows/page/table to access the data which is worked upon according to the query.

Block: When one process blocks the resources of another process then blocking happens. Blocking can be identified by using

SELECT * FROM sys.dm_exec_requests where blocked <> 0
SELECT * FROM master..sysprocesses where blocked <> 0

Deadlock: When something happens as follows: Error 1205

Download SQL Administrator PDF Read All 84 SQL Administrator Questions
Previous QuestionNext Question
Tell us what is the difference between Clustered and Non-Clustered Index?Tell me when setting Replication, can you have Distributor on SQL Server 2005, Publisher of SQL Server 2008?