Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #928

Re: Select affected rows

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Select affected rows
Date 2012-02-07 12:56 +0000
Organization Erland Sommarskog
Message-ID <Xns9FF28DC7B74EDYazorman@127.0.0.1> (permalink)
References <93b61b75-3623-40cb-943e-84afb1451403@dp8g2000vbb.googlegroups.com>

Show all headers | View raw


omtechguy (omtechguy@gmail.com) writes:
> Another question, is there an (NOLOCK) equivalent option for update
> statement?

You can use NOLOCK in an UPDATE statement, even with the table you are 
updating. But of course it does not have any effect.

Overall, NOLOCK is nothing to use at routine, but you need careful 
understanding of the consequences. Not only can you happen to read 
uncommitted data, but you also fail to read existing and committed data, 
which can lead to seriously incorrect results.

If you have problems with locking, you should explore the database setting 
READ_COMMITTED_SNAPSHOT. When this setting is in effect, readers to not 
block writers and vice versa.

-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

Select affected rows omtechguy <omtechguy@gmail.com> - 2012-02-05 01:19 -0800
  Re: Select affected rows bradbury9 <ray.bradbury9@gmail.com> - 2012-02-05 05:04 -0800
  Re: Select affected rows "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-02-07 07:30 -0500
    Re: Select affected rows Erland Sommarskog <esquel@sommarskog.se> - 2012-02-07 12:54 +0000
      Re: Select affected rows "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2012-02-07 10:33 -0500
    Re: Select affected rows bradbury9 <ray.bradbury9@gmail.com> - 2012-02-07 07:03 -0800
  Re: Select affected rows Erland Sommarskog <esquel@sommarskog.se> - 2012-02-07 12:56 +0000

csiph-web