Row level locking | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Row level locking

Hi all, I am using sql server 2000. after few hours while selecting value from the particular table with different values, it doesn’t retrieve the value. is this because of locking in the table?.
or how can i identify the lock in the database? whether is it row level or table level locking?… thanks
You can User SP_LOCK and check for type You Store, I Manage
Hi Does your select query hang or does it not return any results.
Also you can post your query , sample data and expected results so that everyone can analyse more. cheers
Parik****
Hi,<br />more over you have to give some more details .<br />will it return the values !?<br />how many data are their in that table ? is it too big ?<br />is it properly indexed ?<br />have you applied latest patch and sp ?<br /><br />run sp_who2 to get information if any one has block something !<br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br />
Also run the profiler and see
Did you use Begin Trans and forget to commit or rollback it? Madhivanan Failing to plan is Planning to fail
Hi,<br /><br />While accessing my application, it retrieves the values from the errors table and contains assined_to,error_status_key.<br />errors table is having more than 1000 records.<br />My Query:<br />select assigned_to,error_key from errors where error_key=21234;<br /><br />While accessing the same query for different error key, some times the corresponding row is locked. how i can identify which code is causing the lock?<br /> <br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by ghemant</i><br /><br />Hi,<br />more over you have to give some more details .<br />will it return the values !?<br />how many data are their in that table ? is it too big ?<br />is it properly indexed ?<br />have you applied latest patch and sp ?<br /><br />run sp_who2 to get information if any one has block something !<br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br /><br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Hi,<br /><br />When an user accessing the query, in the same time another user also accessing the same query. <br />For ex:<br />select assigned_to,error_status_key from errors where error_key=21234.<br />so while 2 uesrs accessing the same query in the same time, query is keep on running…<br /><br />Because of some issues that error key (21234) row is locked. i do not know how to find that locked row or whats the problem behind for locking the row.<br /><br />So because of row locked, the query did not retrun the value.<br /><br /><br /><br /><br /><br /><br /><br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by ghemant</i><br /><br />Hi,<br />more over you have to give some more details .<br />will it return the values !?<br />how many data are their in that table ? is it too big ?<br />is it properly indexed ?<br />have you applied latest patch and sp ?<br /><br />run sp_who2 to get information if any one has block something !<br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br /><br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
I think to follow the suggestion given by Mr.Madhivanan : Check the status using the Profiler. If you have any open transaction in scripting which is not neccessary to keep open for a long time transaction, script the same in such a way to release in between, keeping in mind not to effect your job. Also, what type of connectivity you are using ?

]]>