如何使用K
declare @waitspid smallint
declare cur cursor for (select spid from sysprocesses where spid in
(select blocked from sysprocesses where blocked <> 0 and waittime > 8000))
fetch cur into @waitspid
while @@fetch_status = 0
begin
print 'start to kill a process'
kill @waitspid---这里编译有错误 (@waitspid附近有语法错误,各位老大如何解决)
fetch cur into @waitspid
end;
close cur ;
deallocate cur;
问题点数:20、回复次数:2Top
1 楼gflpower(燕赤侠)回复于 2005-11-20 15:06:58 得分 0
老大们,如何解决这个问题!
快帮帮我吧
!!Top
2 楼zlp321002(Life Is Good,Let's Shine)回复于 2005-11-20 15:29:29 得分 20
declare @waitspid smallint
declare cur cursor for (select spid from master..sysprocesses where spid in
(select blocked from master..sysprocesses where blocked <> 0 and waittime > 8000))
open cur
fetch cur into @waitspid
while @@fetch_status = 0
begin
print 'start to kill a process'
exec('kill '+@waitspid+'')---这里编译有错误 (@waitspid附近有语法错误,各位老大如何解决)
fetch cur into @waitspid
end
close cur
deallocate cur
Top




