October 6, 2011 at 8:58 am
How would I grant EXECUTE permissions on a stored procedure to a Database Role using T-SQL? I only how to do it using the GUI and I'm forever forgetting that step when I implement a new stored procedure in production.
As I create and alter views & stored procedures, I've been copying the generated scripts into a master implementation script and would like to add at the end of the statements that grant the neccessary permissiosn.
RIP Steve Jobs.
October 6, 2011 at 9:03 am
grant execute on StoredProcName to User
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
October 6, 2011 at 9:10 am
If you're scripting the objects from SSMS, you can also change the default options so it scripts object permissions along with the object. Just go to Tools->Options->SQL Server Object Explorer->Scripting and change "script permissions" to true.
Then, if you've granted the role EXEC permissions in test, the grant statement will also be generated for you when you script the object.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply