--1. 블러킹 정보 확인
SELECT * FROM SYS.sysprocesses WHERE blocked > 0

SP_WHO
SP_WHO2

--2. lock 세부 정보
sp_lock

select *
from sys.dm_tran_locks


--3. 실행쿼리 확인
DBCC INPUTBUFFER(58)


--4.KILL

KILL 58


/*
BEGIN

IF OBJECT_ID('UNILITE.LOCK_TEST') IS NOT NULL
DROP TABLE UNILITE.LOCK_TEST

CREATE TABLE UNILITE.LOCK_TEST
(
ID INT ,
ITEM VARCHAR(20),
QTY INT
)


BEGIN TRAN


INSERT INTO LOCK_TEST (ID, ITEM, QTY)
VALUES(1, 'APPLE',20)
--ROLLBACK
--COMMIT

END


BEGIN

SELECT *
FROM LOCK_TEST

END


+ Recent posts