加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql-server – SQL Server 2008 – 触发器是否以与登录/用户相同

发布时间:2020-12-12 07:29:08 所属栏目:MsSql教程 来源:网络整理
导读:只是一个简单的问题: 假设我在数据库中的表上放置了一个插入触发器. 如果通过登录/用户“foobar”将数据插入该表. 触发器是否以与“foobar”相同的访问权限/权限执行? 非常感谢. 解决方法 是. 您可以使用控制此行为 EXECUTE AS create语句的子句,如explaine
只是一个简单的问题:

假设我在数据库中的表上放置了一个插入触发器.

如果通过登录/用户“foobar”将数据插入该表.

触发器是否以与“foobar”相同的访问权限/权限执行?

非常感谢.

解决方法

是.

您可以使用控制此行为

EXECUTE AS

create语句的子句,如explained here.

触发器的默认值是

EXECUTE AS CALLER

在哪里找到

CALLER

Specifies the statements inside the module are executed in the context of the
caller of the module. The user executing the module
must have appropriate permissions not only on the module itself,but
also on any database objects that are referenced by the module.
CALLER is the default for all modules except queues,and is the same as SQL Server 2005 behavior.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读