--先执行排它锁,锁住所有的表
begin tran
exec sp_MSforeachtable 'select top 1 * from ? with (tablockx)'
--然后调试程序,看看程序访问的表
commit