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 事件探查器未启用'
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 事件探查器未启用'
本文提供了一段SQL Server的T-SQL脚本,用于检查并终止所有与'SQL事件探查器'相关的进程。该脚本首先判断'SQL事件探查器'是否正在运行,如果已启动,则通过游标逐个杀死这些进程。
2823

被折叠的 条评论
为什么被折叠?



