SQL Profile computer trace

sergiosr used Ask the Experts™

Is there anyway to trace what computer is a user logging on a database from? I want to see if more than 1 users use a specific user name and who are those users. If I can trace their computer then I can find out who they are. For example if I have the username "JohnDoe" , I want to see who is using it to log in the database.
So far I was able to trace when the user has activity by filtering by Login Name but not who is actually using that username.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you are using SQL Profiler, COMPUTERNAME or HOSTNAME is an available column.
Try with this select:

select user_name (uid) as [user], loginame, DB_NAME (dbid) as [database], nt_username, hostname, COUNT (*) [Number of connections]
      from sys.sysprocesses with (nolock) where hostname <> ''
group by loginame, nt_username, hostname, dbid, uid
order by 1


That's exactly what I needed! Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial