EXECUTE AS option, which allows a user to be designated for
permissions-checking when running the procedure. The EXECUTE AS user is
automatically given EXECUTE permission on the corresponding SQL procedure.
For scheduled execution runs, if the EXECUTE AS user loses EXECUTE
permission on the procedure or doesn’t have permissions to run the commands
within the procedure, the execution will fail accordingly. If the user doesn’t
exist, the procedure will be executed with definer rights; and if the creator
no longer exists, it will be executed as the system administration user.
For on-demand runs, if the EXECUTE AS user doesn’t have permissions to run
the commands within the procedure, the execution will fail accordingly. If the
user doesn’t exist, the procedure will be executed with invoker rights.
Execute permission on a procedure also allows the grantee to see the contents of
the procedure.