Is it possible to see who is running SQL Server Profiler against a certain database and possibly from what machine? Say through Profiler itself or by T-SQL statement.

I wonder if it is even possible to find out Active Directly user name under which the profiler is running.


[UPDATE] As a reference, here is a way to retrieve only SQL Server Profile processes

declare @sp_who2 table (
	SPID	int,
	status	varchar(50),
	login	varchar(100),
	HostName	varchar(100),
	BlkBy	varchar(100),
	DBName	varchar(100),
	Command	varchar(100),
	CPUTime	int,
	DiskIO	int,
	LastBatch	varchar(50),
	ProgramName	varchar(150),
	SPID2	int,
	REQUESTID	int
)
insert	@sp_who2
exec sp_who2

select	*
from	@sp_who2
where	ProgramName like 'SQL Server Profiler - %'
link|improve this question

77% accept rate
feedback

2 Answers

up vote 6 down vote accepted

Execute

sp_who2

Look at the ProgramName column and you will see something like SQL Server Profiler - 362b6154-2d69-4ce0-987b-2573bed3ce45. From that query you can define a user name and HostName...

link|improve this answer
Yes. Thank you, Bogdan. – Sung Jul 4 '09 at 16:07
feedback

use SQL Profiler and look for existing connection and login events from application name "SQL Server Profiler - {guid}" where {guid} varies by run (and by default SQL Profiler runs exclude themselves based on its own application name.

link|improve this answer
I was wondering what the jumbled up characters meant. It was "guid". Thank you, richard. – Sung Jul 4 '09 at 16:08
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.