Hi there!
In my database client application (C#) I sometimes get an exception telling
me, that my application (which runs a some kind ob batch job) was selected
as deadlock victim and the active transaction was terminated.
No I want to get mor information about, which other application causes the
deadlock.
I thought about executing "sp_lock" just after I received the
deadlock-exception, but I think that this is too late, because my
transaction will be already terminated at this time, and ther won't be a
deadlock any longer.
Can anyone tell me, what would be the best way to receive information about
the active database-connections and their locks, BEFORE the deadlock
situation is cleared by the database-engine?
Is there some kind of trigger or sth. like that?
As the problem doesn't occur regularly, and it's only on the productive
machine, I absolutely don't want to have the profiler active!
Thanks in advance!
Max
Uri Dimant - 30 Jun 2005 08:56 GMT
Markus
Take a look at sp_who2 stored procedure on clolumn blkby (If I remember
well) . That tells you who is blocked and by whom.
Regarding to DEADLOCKS please visit at this site
http://www.sql-server-performance.com/deadlocks.asp
> Hi there!
>
[quoted text clipped - 19 lines]
> Thanks in advance!
> Max
Luciano Caixeta Moreira - 30 Jun 2005 15:08 GMT
Use the trace flag 1024 to receive notifications about deadlocks.
DBCC TRACEON (1024, -1)
[]s
Luciano Caixeta Moreira
Meu blog: http://br.thespoke.net/MyBlog/Luti/MyBlog.aspx
> Markus
> Take a look at sp_who2 stored procedure on clolumn blkby (If I remember
[quoted text clipped - 31 lines]
>> Thanks in advance!
>> Max