What is a NOLOCK?

Answer Posted / michael

Advantage:
applying nolock in select statement will increase
concurreny and performance in fetching.

Disadvantage:
it does'nt consider the transaction scenario, even if the
transaction is under process not yet commited or rollback
it will fetch the current record
eg

begin tran
insert into tablename
values('1','asdf')

select * from tablename with (nolock)

-- it will display the table with inserted record.
but the transaction is not completed, it can be rollback
so it became dirty read.

Is This Answer Correct ?    28 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if null values are involved in datetime operations?

703


What is field with example?

679


Explain what are the authentication modes in sql server?

677


What is SQL Azure Firewall?

128


What are locks in sql?

704






How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?

838


What are page splits? : SQL Server Architecture

738


How many replicas are maintained for each SQL Azure database?

138


Can we delete data from a view?

704


Why we should not use triggers?

683


What is the purpose of object explorer and its features? : sql server management studio

807


What are the types of indexing?

818


What is etl - extraction, transformation, and loading?

665


you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration

703


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

744