-- 检查SQLServer 锁情况 create table #test( spid smallint , dbid smallint , ObjId int , IndId smallint , type nchar ( 4 ) , Resource nchar ( 16 ), Mode nvarchar ( 8 ) , Status nvarchar ( 8 )) insert into #test exec sp_lock select b.name, a. * from #test a, sysobjects b where a.objid = b.id and b.type = ' U ' drop table #test