Prohibition of event probes

xiaoxiao2021-04-01  219

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?

转载请注明原文地址:https://www.9cbs.com/read-131229.html

New Post(0)