|
Posted by Erland Sommarskog on 09/30/18 11:17
reddy via SQLMonster.com (forum@SQLMonster.com) writes:
> I Created deadlock and opened new page and typed the command
> DBCC TRACEON (1205,3605,-1).
> I didn't see any deadlock message except
>
> (End deadlock search 9232 a deadlock was not found)
>
> but in enterprise manager showing spid 54 blocking and spid 55 blocked.
>
> even tried (1204).
Then you are probably not having a deadlock, just blocking. A deadlock
is when two processes block each other in a way so that none of them
can proceed without one of them being rolled back.
To produce a deadlock do this:
CREATE TABLE x(a int NOT NULL PRIMARY KEY,
b int NOT NULL)
go
INSERT x (a, b) VALUES (1, 1)
And then run this from two windows in Query Analyzer:
BEGIN TRANSACTION
SELECT * FROM x WITH (HOLDLOCK)
WAITFOR DELAY '00:00:05'
UPDATE x SET b = 12
ROLLBACK TRANSACTION
One of these process will become a deadlock victim.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|