How to correct this deadlock  error in sql server

Posted on 2014-04-28
Last Modified: 2014-05-15
I have and table consisting of 60000 records.
Now I have 560 users who access any of these records from 60000 rows. And the procedure which executes just update the flag field with 1.

Some times the server  gives dead lock error.
How to correct this.
Question by:searchsanjaysharma
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Assisted Solution

Ganapathi earned 250 total points
ID: 40026744
As the deadlock happens only SOMETIMES, we will have to go with multiple options.

If you don't worry about the integrity of the data, then have WITH(NOLOCK)


Create a Non-Clustered Index on the Flag field that is getting updated


Make sure you have your table's locking schema as DATAROWS
LVL 10

Accepted Solution

PadawanDBA earned 250 total points
ID: 40027392
I would recommend you take a look at implementing a more optimistic view of blocking/locking:

A deadlock scenario is a little different in so far as it is going to occur in the event of similar issues: transaction1 locks object1, transaction2 locks object4, transaction1 needs to lock object4 and transaction2 needs to lock object1.  Neither can finish while the other remains.

Author Closing Comment

ID: 40067340

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question