Groups | Blog | Home
all groups > sql server programming > december 2004 >

sql server programming : usage of updlock


Hassan
12/19/2004 8:43:42 PM
I see a lot of our sprocs developed by developers have select statement with
the updlock. Why would they be doing that ? I know you might be wondering
why I cant ask them directly but thought I not embarass myself and ask you
guys.. Thanks

David Gugick
12/20/2004 12:34:13 AM
[quoted text, click to view]

It's sometimes used when updating "Next Key Value" type tables to keep
others from updating. Of course, an update can do the same thing and
also keep readers away.

Can you give an example of where it is used.


--
David Gugick
Imceda Software
www.imceda.com
Huiyong Lau
12/20/2004 4:26:00 PM
Presume the select statement with updlock hint was used within a explicit
transaction, otherwise it doesnt make sense. It prevents others to modify
the same records, but allow reading still.

Regards,
Huiyong

[quoted text, click to view]

AddThis Social Bookmark Button