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
.
Do I need to grant EXECUTE rights on a function that is called from a stored procedure?
-
23-03-2022 - |
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.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow