spt_values where type='L'number是从0开始的,所以要req_mode+1啊。
謝謝 Garnett_KG 我自己 看幫助不仔細說明裡有: 0 = NULL. No access is granted to the resource. Serves as a placeholder. 1 = Sch-S (Schema stability). Ensures that a schema element, such as a table or index, is not dropped while any session holds a schema stability lock on the schema element. 2 = Sch-M (Schema modification). Must be held by any session that wants to change the schema of the specified resource. Ensures that no other sessions are referencing the indicated object. 3 = S (Shared). The holding session is granted shared access to the resource ......對應number,正好是number+1
帮助说明: 0 = NULL. No access is granted to the resource. Serves as a placeholder. 1 = Sch-S (Schema stability). Ensures that a schema element, such as a table or index, is not dropped while any session holds a schema stability lock on the schema element. 2 = Sch-M (Schema modification). Must be held by any session that wants to change the schema of the specified resource. Ensures that no other sessions are referencing the indicated object. 3 = S (Shared). The holding session is granted shared access to the resource ......select * from master.dbo.spt_values where type='l' LOCK TYPES 0 NULL 1 Sch-S 2 Sch-M 3 S 4 U 5 X 6 IS 7 IU 8 IX 9 ......所以是 master.dbo.syslockinfo.req_mode + 1 = u.number
我自己 看幫助不仔細說明裡有:
0 = NULL. No access is granted to the resource. Serves as a placeholder.
1 = Sch-S (Schema stability). Ensures that a schema element, such as a table or index, is not dropped while any session holds a schema stability lock on the schema element.
2 = Sch-M (Schema modification). Must be held by any session that wants to change the schema of the specified resource. Ensures that no other sessions are referencing the indicated object.
3 = S (Shared). The holding session is granted shared access to the resource
......對應number,正好是number+1
多少开发经验了
yudi010
(★★随风行云★★) 4年
帮助说明:
0 = NULL. No access is granted to the resource. Serves as a placeholder.
1 = Sch-S (Schema stability). Ensures that a schema element, such as a table or index, is not dropped while any session holds a schema stability lock on the schema element.
2 = Sch-M (Schema modification). Must be held by any session that wants to change the schema of the specified resource. Ensures that no other sessions are referencing the indicated object.
3 = S (Shared). The holding session is granted shared access to the resource
......select * from master.dbo.spt_values where type='l'
LOCK TYPES 0
NULL 1
Sch-S 2
Sch-M 3
S 4
U 5
X 6
IS 7
IU 8
IX 9
......所以是
master.dbo.syslockinfo.req_mode + 1 = u.number