本文介绍了代表用户连接到SQL但仍保留用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个WCF服务,它代表用户建立了与我的数据库的所有连接(使用NT进程帐户)。我的DBA质疑如果出现问题,我们将如何知道哪个用户实际运行查询,我们需要终止该请求。



无论如何编码都是为了让我可以向原始用户显示我代表的行为,但仍然在进程帐户下运行sql?我知道我在这里伸展......任何想法都会得到真正的赞赏!



更新:

我想指出......我仍然需要在进程帐户下运行SQL ...而不是调用用户。 SQL是否有办法让我知道我正在为用户运行SQL但不是AS用户,但仍然让SQL知道用户ID正在代表。有意义吗?

I am running a WCF service that makes all connections to my databases on behalf of the user (using an NT process account). My DBA''s questioned how would then know which user is actually running a query should there be issues and we need to kill that request.

Is there anyway of coding so that I can show the original user who I am acting on behalf of but still run the sql under the process account? I know I am stretching here...any ideas would be truely appreciated!

UPDATE:
I want to point out...I still need to run the SQL under the process account...not the calling user. Does SQL have a way I can let it know I am runing the SQL FOR a user but not AS a user but still let SQL know the user id am working on behalf of. Make sense?

推荐答案


这篇关于代表用户连接到SQL但仍保留用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 19:02