0

In order to get a stored procedure plan I'm running the following code:

set showplan_all on
exec sp_name param
set showplan_all off

Now I'm wondering if there's any way of doing that without granting execute permissions to the user running this code. After all, this code does not really execute the procedure but rather display it's plan.

2

1 Answer 1

1

The user must have permission to run the stored procedure at the minimum to get the showplan information. You can just grant the user access to run the one stored procedure and not all of them.

GRANT EXECUTE ON sp_name TO username;
1
  • Thank you @bwilliamson i'm interested in showing plan for all stored procedures. Therefore i must grant execute to username. Jan 23, 2017 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.