| |

VerySource

 Forgot password?
 Register
Search
View: 929|Reply: 1

How to prevent SQL SERVER's event tracker from tracking software scripts?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-10-21 15:30:02
| Show all posts |Read mode
How to prevent SQL SERVER's event tracker from tracking software scripts?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-10-21 20:45:01
| Show all posts
http://community.csdn.net/Expert/topic/5227/5227882.xml?temp=.1036341


--Prohibit profiler
if exists(select * from master.dbo.sysprocesses
           where program_name=N'SQL Profiler')
  begin
   declare tb cursor local for
    select'kill'+rtrim(spid) from master.dbo.sysprocesses
           where program_name=N'SQL Profiler'
   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 Profiler is not enabled'
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list