if   exists(select * from master.dbo.sysprocesses   where   program_name=N'SQL 事件探查器')   

  begin 

   declare tb cursor local  for   

    select 'kill '+rtrim(spid) from master.dbo.sysprocesses   

           where program_name=N'SQL 事件探查器'   

   declare @s nvarchar(100)   

   open tb fetch tb into @s   

   while @@fetch_status=0   

    begin   

     exec(@s)   

     fetch tb into   @s   

    end   

   close tb     

   deallocate tb   

  end 

else 

  print 'SQL 事件探查器未启用'