1.创建一个临时Table
CREATE TABLE #HarveyLock
(
SPID INT,
DBID INT,
OBJID INT,
INDID INT,
TYPE VARCHAR(100),
RESOURCE VARCHAR(100),
MODE VARCHAR(100),
STATUS VARCHAR(100)
)
(
SPID INT,
DBID INT,
OBJID INT,
INDID INT,
TYPE VARCHAR(100),
RESOURCE VARCHAR(100),
MODE VARCHAR(100),
STATUS VARCHAR(100)
)
2.将Lock信息存入该Table
INSERT INTO #HarveyLock EXEC SP_LOCK
3.在Table中下条件查询得到的LOCK
SELECT * FROM #HarveyLock
4.KILL 相关LOCK
KILL @SPID
No comments:
Post a Comment