We have an application which uses a generic database user for all transactions. I need to be able to capture who the NT/Windows was for the transaction in order to create an audit log. I tried capturing the NTuser from sysprocesses using @@spid, but it always returns blank.
How do you capture the windows user when logged in as database user like 'sa'? Is there a function for it? If not, can you write a custom function to capture this info?
Start Free Trial