SQL Server 2008 - Does a trigger run with the same permissions as the login/user?(SQL Server 2008 - 触发器是否以与登录名/用户相同的权限运行?)
问题描述
只是一个简单的问题:
假设我在数据库中的一个表上放置了一个插入触发器.
如果数据是通过登录名/用户foobar"插入到该表中的.
触发器是否以与foobar"相同的访问权限/权限执行?
非常感谢.
是.
您可以使用
控制此行为EXECUTE AScreate 语句的子句,如在此处解释.>
触发器的默认值是
作为调用者执行我们在哪里找到
<块引用>来电者
指定模块内部的语句在上下文中执行模块的调用者.执行模块的用户不仅必须对模块本身具有适当的权限,而且也适用于模块引用的任何数据库对象.CALLER 是除队列之外的所有模块的默认设置,与 SQL Server 2005 的行为相同.
Just a quick question:
Say I put an insert trigger on a table in my database.
If data is inserted into that table through a login/user "foobar".
Does the trigger execute with the same access rights / permissions as "foobar"?
Many thanks.
Yes.
You can control this behaviour with the
EXECUTE AS
clause of the create statement, as explained here.
The default for triggers is
EXECUTE AS CALLER
where we find
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.
这篇关于SQL Server 2008 - 触发器是否以与登录名/用户相同的权限运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL Server 2008 - 触发器是否以与登录名/用户相同的权限运行?
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- SQL 临时表问题 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
