查询死锁进程
select
request_session_id spid, (死锁进程id)
OBJECT_NAME(resource_associated_entity_id) tableName (死锁进程名称)
from sys.dm_tran_locks
where resource_type='OBJECT' (数据类型所有)
杀死死锁进程
declare @spid int //声明id
Set @spid = 62 //设置死锁id
declare @sql varchar(1000) //声明sql
set @sql='kill '+cast(@spid as varchar) //设置 kill掉死锁进程
exec (@sql) //执行