最近写程序常会遇到deadlock victim,每次一脸懵逼.研究了下怎么跟踪,写下来记录下. 建测试数据 CREATE DATABASE testdb; GO USE testdb; CREATE TABLE table1 ( id INT IDENTITY PRIMARY KEY, student_name ) ) INSERT INTO table1 values ('James') INSERT INTO table1 values ('Andy') INSERT INTO table…