Thursday, March 8, 2012

Deadlock

I get the message "Transaction (Process ID 67) was deadlocked on lock
resources with another process and has been chosen as the deadlock victim.
Rerun the transaction".
I think I know what it means but my question is what is a resource ? Can it
be a specific record or it must be a whole table?
Thanks
YannisHi Yannis
Lockable resources include tables, indexes, pages, rows etc.
To find out WHICH resource was involved, you need to collect an output
report from the server called a "deadlock graph" which is written to the SQL
Log in the event a deadlock occurs if you have the following trace flags on:
dbcc traceon (3605, 1204, -1)
You simply run that command in the Query Analyser when logged in as an admin
and any time a deadlock occurs, you inspect the SQL Log (In the Enterprise
Manager under Management). To work out which resources were deadlocking, you
get the object id from the graph & look it up in the database's sysobjects
system table.
This post might be a bit technical, but try & work through it & post back
with any further questions if anything doesn't make sense / isn't clear
enough.
HTH
Regards,
Greg Linwood
SQL Server MVP
"Yannis Makarounis" <Yannis.Makarounis@.ace-hellas.gr> wrote in message
news:OAiNCNwUEHA.1952@.TK2MSFTNGP12.phx.gbl...
> I get the message "Transaction (Process ID 67) was deadlocked on lock
> resources with another process and has been chosen as the deadlock victim.
> Rerun the transaction".
> I think I know what it means but my question is what is a resource ? Can
it
> be a specific record or it must be a whole table?
> Thanks
> Yannis
>

No comments:

Post a Comment