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

application server is slow what may be the problem

1784


What is Cross Join and in which scenario do we use Cross Join?

572


What are the types of ssrs?

108


explain the storage models of olap? : Sql server database administration

522


What are different types of data sources?

496






What is raid, and how it can influence database performance?

579


In what version of sql server were synonyms released?

505


How to get all stored procedures in sql server?

508


What is a bit datatype?

562


How you can find out if an index is useful to the optimizer?

496


tell me what is blocking and how would you troubleshoot it? : Sql server database administration

487


When should you use an instead of trigger?

556


what is the difference between openrowset and openquery?

589


What are the new features of sql server 2008 r2 reporting service?

110


Can primary key be null?

515