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 is a default tcp/ip socket assigned for sql server? : Sql server database administration

526


How to declare and use cursor variables?

576


How to define and use table alias names in ms sql server?

551


Explain the truncate command? : SQL Server Architecture

558


What is coalesce and check constraint in sql server?

537






How to use column default values in insert statements in ms sql server?

521


What is the fastest way to permanently delete a 1 million row table named customers?

591


How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?

1287


What is a non clustered primary key?

502


Explain transaction server explicit transaction?

498


If no size is defined while creating the database, what size will the database have?

542


How to execute multiple stored procedures at one time in sql server?

498


Do you know what is similarity and difference between truncate and delete in sql?

571


explain how to create a new schema in a database? : Sql server database administration

576


Why we need to use secondry database file? though, we can do same work using primary database file also.

5752