dbTalk Databases Forums  

Row Lock On Update Statement

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Row Lock On Update Statement in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe K.
 
Posts: n/a

Default Row Lock On Update Statement - 12-02-2005 , 12:47 PM







What is the correct syntax to create a row lock for an update statement that
updates only a single row in a table? This should help performance since it
does not have to lock the table to update a single row.

Thank You,


Reply With Quote
  #2  
Old   
Janos Horanszky
 
Posts: n/a

Default Re: Row Lock On Update Statement - 12-02-2005 , 01:14 PM






You don't place lock on it, SQL Server will and it won't lock the table for
it.

"Joe K." <Joe K. (AT) discussions (DOT) microsoft.com> wrote

Quote:
What is the correct syntax to create a row lock for an update statement
that
updates only a single row in a table? This should help performance since
it
does not have to lock the table to update a single row.

Thank You,




Reply With Quote
  #3  
Old   
Adam Machanic
 
Posts: n/a

Default Re: Row Lock On Update Statement - 12-02-2005 , 02:55 PM



If your update's WHERE clause uses a key, you should not see the entire
table getting locked. Is that what you're seeing?


--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--


"Joe K." <Joe K. (AT) discussions (DOT) microsoft.com> wrote

Quote:
What is the correct syntax to create a row lock for an update statement
that
updates only a single row in a table? This should help performance since
it
does not have to lock the table to update a single row.

Thank You,




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.