我为 nOOb 问题道歉,但我有一个非常简单的 SQL Server 查询,它从表中选择数据。该表大小约为 18 行,查询如下,
从 SavedJobs 中选择 *
这永远不会在 SQL SERVER MANAGEMENT STUDIO 上完成执行
但是当使用 WITH(NOLOCK) 运行时,它会吐出结果,例如,
SELECT * FROM SavedJobs WITH(NOLOCK)
我相信我的数据库上的某些东西已经锁定了 SavedJobs 表,我想弄清楚并杀死那个锁。有人可以指导我解决这个问题吗?
输出sp_lock
:
spid dbid ObjId IndId Type Resource Mode Status
51 4 0 0 DB S GRANT
52 7 0 0 DB S GRANT
53 7 0 0 DB S GRANT
54 4 0 0 DB S GRANT
55 7 0 0 DB S GRANT
56 7 0 0 DB S GRANT
57 7 0 0 DB S GRANT
58 7 0 0 DB S GRANT
58 1 1131151075 0 TAB IS GRANT
62 4 0 0 DB S GRANT
63 4 0 0 DB S GRANT
64 7 0 0 DB S GRANT
66 9 0 0 DB S GRANT
67 9 0 0 DB S GRANT
68 7 0 0 DB S GRANT
68 7 608721221 1 KEY (ff6a151f422b) X GRANT
68 7 608721221 1 PAG 1:246 IX GRANT
68 7 608721221 2 PAG 1:250 IX GRANT
68 7 608721221 0 TAB IX GRANT
68 7 32719169 0 TAB IX GRANT
68 7 608721221 2 KEY (937ccdaf17f5) X GRANT
69 7 0 0 DB S GRANT
70 7 0 0 DB S GRANT
71 9 0 0 DB S GRANT
72 7 0 0 DB S GRANT
74 9 0 0 DB S GRANT
75 7 0 0 DB S GRANT
76 9 0 0 DB S GRANT
78 9 0 0 DB S GRANT
79 9 0 0 DB S GRANT
85 9 0 0 DB S GRANT
86 7 0 0 DB S GRANT
89 7 608721221 1 PAG 1:246 IS GRANT
89 7 0 0 DB S GRANT
89 7 1243151474 0 TAB IS GRANT
89 7 699149536 0 TAB IS GRANT
89 7 768721791 0 TAB IS GRANT
89 7 608721221 0 TAB IS GRANT
89 7 608721221 1 KEY (ff6a151f422b) S WAIT
89 7 32719169 0 TAB IS GRANT
96 9 0 0 DB S GRANT
98 7 0 0 DB S GRANT
100 7 0 0 DB S GRANT
101 9 0 0 DB S GRANT
102 9 0 0 DB S GRANT
103 9 0 0 DB S GRANT
105 7 0 0 DB S GRANT
106 7 0 0 DB S GRANT