Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Windows login

Author  Topic 

Robowski
Posting Yak Master

101 Posts

Posted - 2013-06-07 : 05:58:58
I don't think this is possible from looking on Google, but is there a way to get the Windows login of the user where a SQL update came from when they are connected to SQL through a SQL login?

I wanted to create an audit table to record bank detail changes that would have been made through a VB front end program which the user would make the change from. The VB front end however writes to SQL using a master login so that will be the one recorded if u use something like SUSER_SNAME(). I;d want it to capture the users windows login rather than the SQL login

Any ideas or is this going to have to be done if this can be done purely through SQL?

Cheers

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-07 : 06:17:35
is there a way to get the Windows login of the user where a SQL update came from when they are connected to SQL through a SQL login?

Not possible if they used a SQL Login to connect to sql server.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Robowski
Posting Yak Master

101 Posts

Posted - 2013-06-07 : 06:19:26
Figured it would be the case, but thanks for confirming!
Go to Top of Page
   

- Advertisement -