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

How to end a stored procedure properly in ms sql server?

554


What is the difference between nvl and nvl2?

558


Can you insert NULL in unique column?

637


How to connect a database with sql express.?

576


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

732






How to use linked server?

598


How to round a numeric value to a specific precision?

575


Tell me what are the advantages of using stored procedures?

572


What is a synonym for manipulation?

554


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

553


What happens if the update subquery returns multiple rows in ms sql server?

595


How to create a user to access a database in ms sql server using "create user" statements?

530


What do you mean by collation recursive stored procedure?

593


Do you know concepts and capabilities of sql server?

586


What are click through reports?

99