SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 SQL Server Profiler issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Apples
Posting Yak Master

146 Posts

Posted - 04/26/2012 :  13:10:39  Show Profile  Reply with Quote
We have about 10 or so users who have access to login to our database and run SQL Server Profiler.

The problem is that they're all using the same username/password to access the database, and every once in a while SQL Server Profiler causes everything to time out. So we're trying to track down who is running the profiler so we can see what exactly is causing the problem.

My developers are all over the country, so is there any way to see the IP address of who is running SQL Server Profiler on the database?

Edited by - Apples on 04/26/2012 16:32:19

robvolk
Most Valuable Yak

USA
15559 Posts

Posted - 04/26/2012 :  13:45:03  Show Profile  Visit robvolk's Homepage  Reply with Quote
This should work:
select c.session_id, c.client_net_address from sys.dm_exec_sessions s 
inner join sys.dm_exec_connections c on s.session_id=c.session_id
where s.program_name like '%profiler%'
Of course the actual problem is;
quote:
We have about 10 or so users who have access to login to our database and run SQL Server Profiler.

The problem is that they're all using the same username/password to access the database,
It's kinda like trying to track down the manufacturer of the bullets that were loaded in the guns of the gang that broke into your (unlocked and unalarmed) store and trashed the place. Developers should never be allowed to run Profiler, much less in production, and absolutely never using the same login (which I'm going to assume is sa).
Go to Top of Page

Apples
Posting Yak Master

146 Posts

Posted - 04/26/2012 :  15:09:17  Show Profile  Reply with Quote
Thanks Rob.

This works, but it only shows me who is currently running SQL Server Profiler. Is there any way to see a history of who has run it?
Go to Top of Page

robvolk
Most Valuable Yak

USA
15559 Posts

Posted - 04/26/2012 :  16:08:11  Show Profile  Visit robvolk's Homepage  Reply with Quote
Only if you run...wait for it...another trace. Or use a logon trigger or event notification to capture such information. You'd have to store that data in a table to maintain a historical record.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000