HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to handle deadlock issue sql server 2008?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
2008handlesqldeadlockissuehowserver

Problem

I have a simple application.This application update data of a table (B) from another table(A) which is changed every 60 sec. User may read data at any time so creating deadlock. How is this sort of problem solved in real world. Considering maximum 100 users how could I avoid deadlock. How would web application handling thousand of request avoid deadlock?

Edit:

Select Query : Select * from tableB
Update Query : update table tableB set tableB.someCOl = tableA.someCol where tableA.col1 = tableB.col3

Solution

The simplest way to reduce deadlocks - proper indexing. Make sure, that client's read requests not involving table/clustered index scans - if any - this is the open gates to deadlocks

And make sure, that your index has its allow_page_lock and allow_row_lock options ON

Context

StackExchange Database Administrators Q#10678, answer score: 2

Revisions (0)

No revisions yet.