imran.baig (4/16/2014)
But what if 2 users are using the same machine with their own user and password? It may be difficult to track in an environment with many users and when users also have a habbit to login from different machines.
yep that's where you cannot know for sure who the user is.
the right solution? disable SQL logins and force them to use AD accounts, but i know in many, many situations that's just not possible.
I'm weaning my own developers off of SQL logins right now.
if you control the application they are using, then you could stuff their network username in CONTEXT_INFO(), which you can then read form the dmv's on a per connection basis.
Lowell