ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How can your resolve deadlocks?
 Question Submitted By :: Laxman
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can your resolve deadlocks?
Answer
# 1
A deadlock occurs when two or more
processes try to access a resource that another process has
a lock on. Microsoft SQL Server automatically
detects these deadlocks, terminates one of the processes,
and rolls back any changes made by that process.
The process chosen for termination will be the one with the
least amount of active time on the server. In
most cases, you can simply reissue the statements that were
rolled back and should have no problems.
 
Is This Answer Correct ?    2 Yes 0 No
Xavier Rajan, Photon Infotech
 
  Re: How can your resolve deadlocks?
Answer
# 2
Deadlocks occour when two or more processes place a lock on 
the same resources and each process waits for the others to 
release the lock.
The options to avoid deadlocks are basically the following:
1) always update data in the same order: if process A 
updates table t1 and then table t2 and process B updates 
table t2 and then table t1 deadlocks can occour. Choose an 
order and use it everywhere in your code.
2) issue the commands again when you catch the deadlock
3) always update data before data selection: no other 
process will place a lock on the modified records
4) identify the processes that can run with lower deadlock 
priority and issue SET DEADLOCK_PRIORITY LOW before these 
statements: this will tell SQLServer that the process is a 
good candidate for killing in case of deadlock, having 
the "important" processes free to run without kills
 
Is This Answer Correct ?    5 Yes 0 No
Ilgian
 
 
 
  Re: How can your resolve deadlocks?
Answer
# 3
Hi 
1) 
First find out which process block the other process from 
activity monitor or sp_who2. Then kill that process. 
2)
If update locks are more  then it will make deadlock. So 
reduce that.
 
Is This Answer Correct ?    3 Yes 1 No
Darshan
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
what is curser.  8
when inserting to a table how many rows will be effected using triggers  1
What is the difference between SSAS 2000 and SSAS 2005? APX1
Can we create clustered index on non primary key column CTS14
Anyone please explain me the concept of Serialization?  3
write coding for importing sql data into a word excel... Oracle1
Difference between sql server 2000 and sql server 2005? Satyam4
what is difference between primary key and Unique  8
plz tell me the new features of sqlserver2000,sqlserver2002,sqlserver2005  3
What are the differences between stored procedure and functions in SQL Server 2000? TCS12
Can a stored procedure call itself(recursive). If yes what level and can it be controlled.?  2
How do we get current date in SQL Server 2000, Oracle, MS Access?  11
What are the magic tables in SQL Server 2000? Infogain5
Can we call SP inside a query? Wipro4
Different Types of Functions ? Satyam2
What are the all different types of Joins in SQL Server 2000, Anybody can explain each join with definition..Thanks in advance.... Siemens6
Say if we have a table that contains only a single column , say OrderID, which has IDENTITY attribute defined on it. So how can we insert data in this table. I am reframing my question, that how can we make the table to increment the column "OrderID" value several times???  3
What is the use of CASCADE CONSTRAINTS?  2
how will u create "n" possible tables in sql... Oracle1
What is normalization and its forms? Challenger-Financial3
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com