sql2000写入过程死机

来源:百度知道 编辑:UC知道 时间:2024/05/12 16:51:39
SQL Server 已为 8 个并发查询而优化。1 个查询超过了此限制,因而性能可能会受到不良影响。
我们是在上传写入数据时出现这个情况,类似于数据堵塞
明显是数据库读入了死状态,吧网线拔了就好了,后来在日志里看到的这个记录
主要是找不到原因...
出现这种情况不都是在数据量大的时候,也有很空闲时
补丁好用就不发这了

/*...这样的问题应该去CSDN问..或者翻翻老帖子 你会找到相关方案 ...

下面这个存储过程是查询死锁的...*/
create procedure sp_who_lock
as
begin
declare @spid int,@bl int,
@intTransactionCountOnEntry int,
@intRowcount int,
@intCountProperties int,
@intCounter int

create table #tmp_lock_who (
id int identity(1,1),
spid smallint,
bl smallint)

IF @@ERROR<>0 RETURN @@ERROR

insert into #tmp_lock_who(spid,bl) select 0 ,blocked
from (select * from sysprocesses where blocked>0 ) a
where not exists(select * from (select * from sysprocesses where blocked>0 ) b
where a.blocked=spid)
union select spid,blocked from sysprocesses where blocked>0

IF @@ERROR<>0 RETURN @@ERROR

-- 找到临时表的记录数
select @intCountProperties = Count(*),@intCounter = 1
from #tmp_lock_who

IF @@ERROR<>0 RETURN @@ERROR