Question

I have a SQL function that is only called from inside another stored procedure. I have granted EXECUTE rights for the stored procedure that calls the function.

Do I need to grant EXECUTE permissions to the function as well?

EDIT

In response to the comment from @AaronBertrand

The function does not access any other objects in the database. It is used to build a string.

Was it helpful?

Solution

If the problem is that your user can't execute it, try dropping and re-creating the function, and applying the appropriate permissions on the function itself and any object(s) it references. There may be a DENY hanging around, which will always trump GRANT.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top