开发者

Get logged-in asp.net membership user from SQL Server Table Trigger

I want to do some simple data change auditing on an SQL开发者_开发问答 Server table. I have created the trigger as explained in this article http://www.simple-talk.com/sql/database-administration/pop-rivetts-sql-server-faq-no.5-pop-on-the-audit-trail/

But when a user log's into the ASP.net application with their asp.net membership account and do a data update, the trigger captures "NT AUTHORITY\SYSTEM" as the name of the user who made the changes to the data. Is there away of getting the logged-in asp.net user name from the trigger instead of this generic NT AUTHORITY\SYSTEM.


you are seeing nt authority because that is the identity of the app pool that the worker process is running in.

the only way you will see the actual user is if you use AD authentication and set impersonation true.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜