The mysterious ‘MD’ lock type, and why you should stop using sp_lock

Today during some discussions with customers, there was a question about some locks being held by a session. Here is an example reproduced below: begin tran select * from Person.Person where LastName = ‘Singh’ exec sp_lock @@spid Here is the output: spid    dbid    ObjId    IndId    Type    Resource    Mode    Status 52    11    0    0    DB                                        S   …

2