Hello,
In our application I can let a user execute a Function with the Execute As option set to ‘sa’, but can't seem to do the same with a procedure. It gives the following error when executing:
Seeing as I can execute a function as ‘sa’ just fine, user ‘sa’ must be available to me. Can anyone explain why this is happening?
For some context, I want my user to be able to use the results of xp_dirtree, but don't want to give him the rights of sysadmin. I need this to be a procedure since I can't use a temporary table in a function and I need to select rows from the output of xp_dirtree.
Thanks in advance.