O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lock Type Hints

You can use the following optimizer hints to override the lock type that SQL Server chooses to use:

Image UPDLOCK—This option is similar to HOLDLOCK except that whereas HOLDLOCK uses a shared lock on the resource, UPDLOCK places an update lock on the resource for the duration of the transaction. This allows other processes to read the information but not acquire update or exclusive locks on the resource. This option provides read repeatability within the transaction while preventing potential deadlocks that can result when using HOLDLOCK.

XLOCK—This option places an exclusive lock on the resource for the duration of the transaction. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required