In sql is it possible to script permissions as one can with the stored proc itself? So that I can simply tell somebody to hit execute and the proc and permissions just get created all at once.
+1
A:
Yes, you can script the execute permission as follows:
use [database_name]
GO
GRANT EXECUTE ON [dbo].[stored_procedure_name] TO [user_name]
GO
Replace the database_name, stored_procedure_name and user_name values with the appropriate values.
If you include this in your script after the SP CREATE statement it will add the permissions right after the SP is created.
TLiebe
2010-10-08 13:43:12
That does the trick! (Oddly enough Stack wont let me choose yours as answer for another 8 minutes).
P.Brian.Mackey
2010-10-08 13:45:24