Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Executing query

Author  Topic 

misterraj
Yak Posting Veteran

94 Posts

Posted - 2010-08-02 : 01:10:33
when i query in enterprise Mgr:
select * from tablename
It executs and executes, may be its locked.
how to find out which process is holding it?

thanks,
Venkat.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-08-02 : 01:25:01
sp_lock


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

misterraj
Yak Posting Veteran

94 Posts

Posted - 2010-08-02 : 01:35:46
sp_lock gives me some set of records, it gives me 85 records.
how would i know which process is holding it?

any particular query to filter out?/ how to decode the output of sp_lock

this is the output:

spid dbid ObjId IndId Type Resource Mode Status
51 4 0 0 DB S GRANT
53 11 0 0 DB S GRANT
54 17 0 0 DB S GRANT
55 9 0 0 DB S GRANT
56 7 0 0 DB S GRANT
57 19 0 0 DB S GRANT
58 13 0 0 DB S GRANT
60 17 0 0 DB S GRANT
61 17 0 0 DB S GRANT
62 19 0 0 DB S GRANT
63 13 0 0 DB S GRANT
65 4 0 0 DB S GRANT
66 17 0 0 DB S GRANT
67 1 1115151018 0 TAB IS GRANT
68 18 0 0 DB S GRANT
68 18 0 0 APP 0:[ENVIRONNEXTTST_B]:(e4baf684) X GRANT
69 18 0 0 DB S GRANT
70 18 0 0 DB S GRANT
70 18 0 0 APP 0:[ENVIRONNEXTTST_B]:(a58bed9d) X GRANT
71 18 0 0 DB S GRANT
72 18 0 0 DB S GRANT
73 19 0 0 DB S GRANT
73 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
74 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
74 19 0 0 DB S GRANT
76 18 0 0 DB S GRANT
77 19 0 0 DB S GRANT
77 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
78 18 0 0 DB S GRANT
79 19 0 0 DB S GRANT
79 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
80 18 0 0 DB S GRANT
81 19 0 0 DB S GRANT
81 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
82 18 0 0 DB S GRANT
83 16 0 0 DB S GRANT
84 19 0 0 DB S GRANT
84 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
85 19 0 0 APP 0:[ManageMessageRef]:(28c8c5ab) X GRANT
85 19 0 0 DB S GRANT
86 18 0 0 DB S GRANT
87 19 0 0 DB S GRANT
87 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
88 19 0 0 APP 0:[TDDS_Session_Reg]:(5ef8e0fd) S GRANT
88 19 0 0 DB S GRANT
89 19 0 0 DB S GRANT
93 12 0 0 DB S GRANT
94 13 0 0 DB S GRANT
97 14 0 0 DB S GRANT
98 14 0 0 DB S GRANT
100 13 0 0 DB S GRANT
101 13 0 0 DB S GRANT
102 11 661577395 4 KEY (9e02b364b336) X GRANT
102 11 357576312 0 TAB IX GRANT
102 11 0 0 DB S GRANT
102 11 661577395 4 PAG 1:100324 IX GRANT
102 11 357576312 0 PAG 1:172363 IX GRANT
102 11 661577395 0 PAG 1:87631 IX GRANT
102 11 661577395 0 RID 1:87631:0 X GRANT
102 11 661577395 3 KEY (4002e1fa4ac3) X GRANT
102 11 661577395 0 RID 1:272598:0 X GRANT
102 11 661577395 0 PAG 1:272598 IX GRANT
102 11 357576312 5 PAG 1:277305 IX GRANT
102 11 357576312 5 PAG 1:277304 IX GRANT
102 11 661577395 0 RID 1:87631:3 X GRANT
102 11 661577395 0 PAG 1:277427 X GRANT
102 11 357576312 2 PAG 1:277408 IX GRANT
102 11 357576312 3 PAG 1:127303 IX GRANT
102 11 661577395 2 KEY (0c02dffc852b) X GRANT
102 11 357576312 0 RID 1:172363:30 X GRANT
102 11 357576312 4 KEY (4d00d13aa805) X GRANT
102 11 661577395 0 TAB IX GRANT
102 11 661577395 3 PAG 1:47752 IX GRANT
102 11 357576312 4 PAG 1:175621 IX GRANT
102 11 357576312 3 KEY (b50122285968) X GRANT
102 11 357576312 5 KEY (9f02d7f78df1) X GRANT
102 11 357576312 2 KEY (81011c2e9680) X GRANT
102 11 661577395 2 PAG 1:97740 IX GRANT
103 7 0 0 DB S GRANT
105 13 0 0 DB S GRANT
110 9 0 0 DB S GRANT
112 9 0 0 DB S GRANT
209 7 0 0 DB S GRANT
244 11 0 0 DB S GRANT
251 10 0 0 DB S GRANT
271 11 0 0 DB S GRANT
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-08-02 : 01:39:15
refer to Books Online on sp_lock http://msdn.microsoft.com/en-us/library/ms187749.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

misterraj
Yak Posting Veteran

94 Posts

Posted - 2010-08-02 : 01:58:47
There is no mention about the table on which process is holding to. I get the database information, but can it be funneled to 'table information' ?
Go to Top of Page
   

- Advertisement -