从SQL Server表触发器获取登录的asp.net会员用户
我想对 SQL Server 表进行一些简单的数据更改审核。我已经按照本文所述创建了触发器 http://www.simple-talk.com/sql/database-administration/pop-rivetts-sql-server-faq-no.5-pop-on- the-audit-trail/
但是,当用户使用其 asp.net 会员帐户登录 ASP.net 应用程序并进行数据更新时,触发器会捕获“NT AUTHORITY\SYSTEM”作为对数据进行更改的用户的名称。是否可以从触发器获取登录的 asp.net 用户名而不是这个通用的 NT AUTHORITY\SYSTEM。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您看到的是 nt 权限,因为这是运行工作进程的应用程序池的标识。
您看到实际用户的唯一方法是使用 AD 身份验证并将模拟设置为 true。
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.