I need to make a trigger about who and when created a view. I have some groundwork about it.. So, when some user is running a script for create view, trigger is crushing because this user doesn't have a permission to insert. When I use trigger with EXECUTE AS OWNER, there is a problem with it. Problem - OWNER is not a valid parameter for EXECUTE AS in the context of server and database level triggers.
closed as unclear what you're asking by Erik Darling, mustaccio, Vérace, hot2use, LowlyDBA Dec 11 '18 at 18:52
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
execute as self
create or alter trigger check_view on database with execute as self for create_view as . . .
execute as 'dbo'
create or alter trigger check_view on database with execute as 'dbo' for create_view as . . .