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 - 触发器是否以与登录名/用户相同的权限运行?
基础教程推荐
- 在 SQL 中连接多个表 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 无法解决整理冲突 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
