How to make a trigger for create_view 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.
Use execute as self

create or alter trigger check_view 
on database
with execute as self
for create_view
as . . .


or execute as 'dbo'

create or alter trigger check_view 
on database
with execute as 'dbo'
for create_view
as . . .