How can you check to see if a user can execute a stored procedure in MS SQL server?
I can see if the user has explicit execute permissions by connecting to the master database and executing:
databasename..sp_helpprotect 'storedProcedureName', 'username'
however if the user is a member of a role that has execute permissions sp_helprotect won't help me.
Ideally I'd like to be able to call something like
databasename..sp_canexecute 'storedProcedureName', 'username'
which would return a bool.