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 2008 Forums
 SQL Server Administration (2008)
 Locked tables

Author  Topic 

rohitmathur11
Yak Posting Veteran

77 Posts

Posted - 2009-12-07 : 02:37:04
Hi,
how can i check that what all tables are locked in to database currently and by which user(session) ...is there any sql query for this.

any idea..?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-07 : 04:41:37
EXEC sp_lock

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-07 : 04:44:39
Hi

Use sys.dm_tran_locks

-------------------------
R...
Go to Top of Page

rohitmathur11
Yak Posting Veteran

77 Posts

Posted - 2009-12-08 : 01:42:49
ok..these views will show object id like which is locked ...


so first i need to get object id then i can check lock ...?




Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-08 : 03:52:56
Object_name(objectid) will give you object name

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -