1. Use sp_lock to see if the output information LockType contains-BLK characters, indicating that the lock on the page table_id the current table is blocking other processes
2. By viewing master. Syslocks system table
Cases
ID dbid page Type SPID class FID context row loid
----------- ------ ----------- ------ ------ -----
512004855 6 0 3 Non Cursor Lock 0 0 0 26
512004855 6 0 4 Non Cursor Lock 0 0 0 24
512004855 6 0 3 Non Cursor Lock 0 0 0 20
512004855 6 793 261 Non Cursor lock 0 8 0 26 The current blocking and blocked processes are known from the SPID, and the types of locks are available from the Type field, as shown in the following table:
1 0x1 table lock
2 0x2 Shared table lock
3 0x3 Exclusive Intent Lock
4 0x4 Shared Intent lock
5 0x5 Exclusive page lock
6 0x6 Shared Page lock
7 0x7 Update page lock
8 0x8 Row Lock
9 0x9 shared row lock
0xA Update row lock
0xB Share Next Key lock
256 0x100 Lock is blocking another process
0X200 Request Lock
So you can get blocking table information from the following query
Select B.name as dbname,a.id as table_id,page,spid from syslocks a,sysdatabases b
where b.dbid = A.dbid
and A.type & 256 = 256
You can also write a stored procedure, but be sure to do it in master.