2

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 - %'
7

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...

2

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.

  • I was wondering what the jumbled up characters meant. It was "guid". Thank you, richard. – dance2die Jul 4 '09 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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