从SQL Server表触发器获取登录的asp.net会员用户

发布于 2024-09-30 06:23:21 字数 491 浏览 0 评论 0原文

我想对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

舞袖。长 2024-10-07 06:23:21

您看到的是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文