Created
October 13, 2015 08:54
-
-
Save andyj/d0a4eabf51e83f678c40 to your computer and use it in GitHub Desktop.
Transaction (Process ID) was deadlocked on lock - find and kill process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE #Result | |
( | |
spid int, | |
ecid int, | |
status varchar(max), | |
loginname varchar(max), | |
hostname varchar(max), | |
blk varchar(max), | |
dbname varchar(max), | |
cmd varchar(max), | |
request_id int | |
) | |
INSERT #Result EXEC sp_who | |
SELECT * FROM #Result WHERE dbname LIKE '%XXX%' | |
DROP TABLE #Result | |
-- Once you know the SPID you can run | |
KILL 28 -- or whatever the SPID is |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment