April 8, 2011 at 2:02 pm
I know you can grant access to a stored procedure by added this to the bottom of a stored procedure.
GRANT EXECUTE ON myStoredProcedureName TO PUBLIC
How do you grant access to the public for a function? :ermm: I tried adding "GRANT SELECT ON [myfunction] TO PUBLIC" but I keep getting "Invalid use of a side-effecting operator 'GRANT' within a function."
April 8, 2011 at 2:14 pm
sounds like you need a GO statement between the function and the GRANT SELECT myFunction statement.
the function is trying to compile with the GRANT statement as part of it's body,and that's not allowed.
Lowell
April 8, 2011 at 2:21 pm
It worked when I changed it to execute instead of select. Thnx
April 11, 2011 at 3:08 pm
For FUNCTION, when it is a TVF, you have to use "GRANT SELECT". Otherwise, "GRANT EXEC".
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy