1 -- 查询死锁 2 --第一种 3 sp_lock 4 5 --第二种 6 select object_name(resource_associated_entity_id) as tableName, request_session_id as pid,* from sys.dm_tran_locks 7 where resource_type = 'OBJECT' ORDER BY pid 8 9 --查询死锁相应的预计 10 DBCC INPUTBUFFER(spid) 11 12 --杀死死锁 13 kill spid