SQL Database Concepts Question:

Do you know what is a WITH(NOLOCK)?

Tweet Share WhatsApp

Answer:

WITH(NOLOCK) is used to unlock the data which is locked by the transaction that is not yet committed. This command is used before SELECT statement.
When the transaction is committed or rolled back then there is no need to use NOLOCK function because the data is already released by the committed transaction.
Syntax: WITH(NOLOCK)
Example:
SELECT * FROM EmpDetails WITH(NOLOCK)
WITH(NOLCOK) is similar as READ UNCOMMITTED

Download Basic SQL Server PDF Read All 113 Basic SQL Server Questions
Previous QuestionNext Question
Explain what is use of DBCC Commands?Explain what is Log Shipping?