SQL Server - what is a use of nolock and lock in sql server

Asked By shoaib mansoori on 02-Dec-12 01:37 PM
Hi all
what is a use of nolock and lock in normal query in sqlserver?


when we use locking in transaction and why?
Hemanth Kumar replied to shoaib mansoori on 03-Dec-12 01:52 AM

Use nolock when you are okay with the "dirty" data. Which means nolock can also read data which is in the process of being modified and/or uncommitted data.

It's generally not a good idea to use it in high transaction environment and that is why it is not a default option on query.