I ran this to create a trigger but failed with an error below.
CREATE TRIGGER validateLogonTrigger
ON ALL SERVER WITH EXECUTE AS 'logonTrigger'
DECLARE @time time(0) = getdate()
IF ORIGINAL_LOGIN() = 'ReportUser'
AND @time BETWEEN '23:00:00' and '23:30:00'
Msg 15151, Level 16, State 1, Procedure validateLogonTrigger, Line 12
Cannot execute as the login 'logonTrigger', because it does not exist or you do not have permission.
What's wrong and what should I fix?
Thank you for your support
View Complete Post