查看sp_Lock代碼,有一段 :master.dbo.syslockinfo.req_mode + 1 = u.number想問問大家,
為什麼是 req_mode + 1 = u.number,而不是:req_mode 1 = u.number謝謝大家

解决方案 »

  1.   

    spt_values where type='L'number是从0开始的,所以要req_mode+1啊。
      

  2.   

    謝謝 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
      

  3.   

    Star_100开始研究这些了啊
    多少开发经验了
      

  4.   

    to :
    yudi010
     (★★随风行云★★) 4年
      

  5.   

    星星,是我。[email protected]。在那边还好吧?
      

  6.   

    没有看到spt_values表,如果是用到那个表,正因为是从0开始的,为什么不是减1呢
      

  7.   


    帮助说明:
    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