If exists (select * from master.dbo.sysprocesses where program_name = n'sql event probe)
Begin
Declare TB CURSOR LOCAL FOR
SELECT 'KILL' RTRIM (SPID) from master.dbo.sysprocesses
Where program_name = n'sql event probe
Declare @s nvarchar (100)
Open tb fetch tb info @S
While @@ fetch_status = 0
Begin
EXEC (@S)
Fetch Tb Into @S
end
Close TB
DEAALLOCATE TB
end
Else
Print 'SQL Event Progressor is not enabled?