I am using sql trace , please tel me where i can get the value for mode of lock and type of resource.

hi,

   I am using sql trace , it has cols like mode and type , but they have numbers , is there any place where i can get the metadata of these values

yours sincerley

February 18th, 2015 8:21am

SELECT top 300 textdata,cpu,reads,databasename,duration 
FROM fn_trace_gettable('c:\tracefile.trc', default)
order by cpu desc;
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 8:51am

i was asking about mode col in events,

it has numbers of lock types , so i was asking about where i can get  metadata

of the  value 

example 4=Update Lock (LCK_M_U) so either i  have to put cases or if get any tabel where meta data exist then i will put join.

Q2) i have one more question in which col of the event, i can have lock reuest status , like weather it is 

granted or wait.

yours sincerley

February 18th, 2015 8:57am

For every event in sql profiler, eg Lock:Acquired, you can search "Lock:Acquired Event Class" in your favourite search engine to find the "msdn" page for it.

Check this

https://msdn.microsoft.com/en-us/library/ms189897.aspx

Resulting mode after the lock was acquired.

0=NULL - Compatible with all other lock modes (LCK_M_NL)

1=Schema Stability lock (LCK_M_SCH_S)

2=Schema Modification Lock (LCK_M_SCH_M)

3=Shared Lock (LCK_M_S)

4=Update Lock (LCK_M_U)

5=Exclusive Lock (LCK_M_X)

6=Intent Shared Lock (LCK_M_IS)

7=Intent Update Lock (LCK_M_IU)

8=Intent Exclusive Lock (LCK_M_IX)

9=Shared with intent to Update (LCK_M_SIU)

10=Shared with Intent Exclusive (LCK_M_SIX)

11=Update with Intent Exclusive (LCK_M_UIX)

12=Bulk Update Lock (LCK_M_BU)

13=Key range Shared/Shared (LCK_M_RS_S)

14=Key range Shared/Update (LCK_M_RS_U)

15=Key Range Insert NULL (LCK_M_RI_NL)

16=Key Range Insert Shared (LCK_M_RI_S)

17=Key Range Insert Update (LCK_M_RI_U)

18=Key Range Insert Exclusive (LCK_M_RI_X)

19=Key Range Exclusive Shared (LCK_M_RX_S)

20=Key Range Exclusive Update (LCK_M_RX_U)

21=Key Range Exclusive Exclusive (LCK_M_RX_X)

Also check these https://msdn.microsoft.com/en-us/library/ms190292.aspx

Free Windows Admin Tool Kit Click here and download it now
February 18th, 2015 9:20am

I have already found, but the problem is, i have to put cases to show lock in fornt of numbers , what i wanted

is if i could get this mapping any where in database like( metadata is kept) , then i have to put only join.

Q2) I have one more question in which col of the event, i can have lock request status , like weather it is 

granted or wait.

yours sincerly


February 18th, 2015 11:41pm

I have already found, but the problem is, i have to put cases to show lock in fornt of numbers , what i wanted

is if i could get this mapping any where in database like( metadata is kept) , then i have to put only join.

Q2) I have one more question in which col of the event, i can have lock request status , like weather it is 

granted or wait.

yours sincerly


  • Edited by rajemessage Thursday, February 19, 2015 4:52 AM
Free Windows Admin Tool Kit Click here and download it now
February 19th, 2015 4:39am

Good day 

Is this still an issue?

If not, then please close the thread by marking an answer/s

March 23rd, 2015 9:25pm

ya it is still an issue.

yours sincerely

Free Windows Admin Tool Kit Click here and download it now
March 24th, 2015 3:13pm

I have already found, but the problem is, i have to put cases to show lock in fornt of numbers , what i wanted

is if i could get this mapping any where in database like( metadata is kept) , then i have to put only join.

Q2) I have one more question in which col of the event, i can have lock request status , like weather it is 

granted or wait.

yours sincerly


Q1. You can create a table from the data in the link that Ashwin Menon posted, and use simple JOIN in order to replace the numbers with the Mode

Q2. Please check this great blog:
http://aboutsqlserver.com/2011/05/26/locking-in-microsoft-sql-server-part-4-how-to-detect-blocking/

March 27th, 2015 6:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics