• 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!