日期:2014-05-18 浏览次数:20529 次
declare Roy_lock cursor for select db_name(dbid),0,blocked from master..sysprocesses a where Blocked>0 and not exists(select 1 from Master..Sysprocesses where blocked=a.spid) union select db_name(dbid),spid,blocked from master..sysprocesses a where Blocked>0 declare @DBName sysname,@spid bigint,@Blocked bigint open Roy_lock fetch next from Roy_lock into @DBName,@spid,@Blocked while @@fetch_status=0 begin if @spid=0 print N'鎖定數據庫:'+@DBName+' 語句:' else print N'鎖定數據庫:'+@DBName+' 進程SPID:'+rtrim(@spid)+' 語句:' dbcc inputbuffer(@Blocked) fetch next from Roy_lock into @DBName,@spid,@Blocked end close Roy_lock deallocate Roy_lock
------解决方案--------------------
看来楼上版主也不怎么样哦,技术还没有更新,还是查Master..Sysprocesses这个表
------解决方案--------------------
很有可能是PB代码的问题,查看一下登录过程中,对用户表的使用情况,
应该是没有及时释放锁,提交事务或ADO控件的参数不正确.
------解决方案--------------------