RE: deadlocks in SQL

RE: deadlocks in SQL

 

  

FIRST SUGGESTION is turn on trace flag 1204. then when there is a deadlock it will put information in the SQL errorlog that will tell you what databases/tables/queries/sps etc. were involved.

In short it is 2 processes conflicting for the same resource(data page, row etc.) Normally you get a blocking situation like when someone is updating a table and a query comes thru with a scan the update will block it. Then the update finishes the query will continue.

But when 2 processes get tied up and the first one needs something the second one already has locked, and the second one needs something the first one has locked, then the system will resolve by killing one of the 2(usually the last one in)


Thanks,
Ralph W. Davis
*********************************************************
*** CORPORATE DBA group - Houston ***
*********************************************************

-----Original Message-----
From: John A DAVIS [mailto:mssqldba-ezmlmshield-x18603875.[Email address protected]
Sent: Tuesday, January 31, 2006 11:17 AM
To: LazyDBA Discussion
Subject: Re: deadlocks in SQL

First, make sure all your delevopment code is closing down it's connection objects; both after use, and in case of error, and after so much time.
rs.Close
Set rs = Nothing
conn.Close
Set conn= Nothing

Signed,
Developer at large

There is a lot more stuff you can do at SQL Server level, but I figure someone on this list knows more than me.




>>> "Gil Edmund " <mssqldba-ezmlmshield-x83347327.[Email address protected] 1/31/2006 8:11 AM >>>

Hey everyone I am experiencing SQL deadlocks...can some provide some overview on what this is all about and how I might resolve this issue?

Thanks,
Edmund Gil,
Oss Team Lead





_______________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.

Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite.
Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html





---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html

Confidentiality Note: The information contained in this message, and any
attachments, may contain confidential and/or privileged material. It is intended
solely for the person or entity to which it is addressed. Any review,
retransmission, dissemination, or taking of any action in reliance upon this
information by persons or entities other than the intended recipient is
prohibited. If you received this in error, please contact the sender and delete
the material from any computer.


MS Sql Server LazyDBA home page