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                      
tip   SiteMap shows list of All Categories in this site.
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
What is deadlock and how to avoid the deadlocks.
 Question Submitted By :: Bhaskar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is deadlock and how to avoid the deadlocks.
Answer
# 1
A deadlock occurs when there is a cyclic dependency between 
two or more threads for some set of resources.
 
Is This Answer Correct ?    4 Yes 0 No
Moin
 
  Re: What is deadlock and how to avoid the deadlocks.
Answer
# 2
Consider there are transcations going on 1 row, some one is 
trying to update a column in that row while others are 
trying to retrive data of same row,while update locks the 
row for some period of time others cannot select it, hence 
deadlock occurs.

To kill the process is solution. In sql server 2005 use sql 
profiler to view the process, in that see the column named 
transactions if its value is more than 1 right click and 
kill the process.
 
Is This Answer Correct ?    3 Yes 2 No
Raghu
 
 
 
  Re: What is deadlock and how to avoid the deadlocks.
Answer
# 3
P1 has lock on R1
P2 has lock on R2
P1 requests lock on R2
P2 Requests lock on R1

Where P & R are corresponding processes and resources.

Deadlock consists of two processes requesting locks on
resources thus, blocking each other.

You can avoid Deadlocks:
Access objects in the same order
Use lower isolation levels
Keep Transactions short and in one batch
Avoid user interactions in transaction
Use bound connections
 
Is This Answer Correct ?    4 Yes 0 No
Dba
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What are the type of Indexes? which one is best, why?  5
what purpose does OPENXML clause have in sql server stored procedure?  1
is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes or conversion errors?  2
Can we create clustered index on non primary key column CTS14
What is normalization?  6
What is the difference between distinct clause and group by clause? Value-Labs1
what are file groups? Evalueserve3
I need a query that retrieves info from an Oracle table and a query that retrieves info from a SQL Server table. The info has to be joined together according to Record ID numbers. I have very limited access to the Oracle database but full control of the SQL Server database.How do I join two different queries from two different databases?  1
Delete duplicate rows from a table without primary key by using a single query Table Employee empname salary A 200 B 300 A 200 C 400 D 500 D 500 Output should be A 200 B 300 C 400 D 500  2
what is the Surrogate key?and wt is the diff between Primary key and Surrogate Key?  2
What is the difference between having and where clause?  4
How to Get the last identity value used  4
What are sub-queries? Give example? In which case sub-queries are not feasible? Infosys3
Explain Trigger with an example?  1
What is the order in which the SQL query is executed? list them in order. CTS1
What is Report Server,Report Manager and Report Builder in SSRS 2005?  1
Alternative way to DetDate() function?  4
What is SQL server agent? SAP-Labs2
Explain the storage models of OLAP?  1
What is the use of DBCC commands?  1
 
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