SQL Server 2008 - Does a trigger run with the same permissions as the login/user?

纵饮孤独 提交于 2019-12-05 06:30:33

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.

by default yes, but you can change that using

WITH EXECUTE AS

on the trigger definition

http://msdn.microsoft.com/en-us/library/ms188354(v=sql.100).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!