|
发表于 2020-10-21 20:45:01
|
显示全部楼层
http://community.csdn.net/Expert/topic/5227/5227882.xml?temp=.1036341
--禁止事件探查器
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 事件探查器未启用' |
|