22,210
社区成员
发帖
与我相关
我的任务
分享
--杀死占用进程
declare #spid cursor for
select spid=cast(spid as varchar(20)) from master..sysprocesses where dbid=db_id(@db);
open #spid
fetch next from #spid into @spid;
while @@fetch_status=0
begin
exec('kill '+@spid);
fetch next from #spid into @spid;
end
close #spid;
deallocate #spid;
set @iscreate=0;