如何从会话ASP.net获取IdUs​​er进行触发 [英] How to Get IdUser from Session ASP.net to Trigger

查看:76
本文介绍了如何从会话ASP.net获取IdUs​​er进行触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先...我为自己的错误表示歉意.

我为表上的操作创建了一个触发器...我想将ID User存储在必须位于触发器内的数据库中.

如何在asp.net中的会话级别上带入ID?

Firstly...I apologize for my mistakes English

I create a trigger for operations on the tables ... I would like to store the ID User within the database which must be within trigger.

How can I bring ID as it is at the level of the session in asp.net?

推荐答案

基本上,您不能.

当您想要在应用程序中使用所需信息(登录用户)时尝试使用触发器在数据库中进行审核时,就会出现此问题.

尼克
Basically, you can''t.

This is the problem when you try to do auditing in the database using triggers when the information you want ( the logged-in user ) is in the app.

Nick


这是我们在触发器中使用的代码的一部分,我们将其插入到日志文件中:
Here is part of the code we use in our trigger that we insert into a log file:
SELECT
    GETDATE(), SYSTEM_USER, @@ServerName, APP_NAME(), HOST_NAME(), ...(inserted/deleted info)


也许会有所帮助.


maybe it will help.


这篇关于如何从会话ASP.net获取IdUs​​er进行触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆