I am looking for a way to have a database user only have rights to execute stored procedures and functions. This needs to be a dynamic setting so that every time i add a stored procedure or function they have rights to it.
Constraints
I cannot change the names of the schema or stored prcedures or functions.
In SQL Server 2005 and newer, you can create a new database role
and then grant that role the permission to execute – without specifying anything.
This role can now execute all stored procedures and function in the database – and it will be able to execute any future stored procedures you add to the database, too!
So now just add this role to your user and you’re done:
PS: of course, you could also grant this permission to just a single user:
This makes management a nightmare, however – so I wouldn’t go down that path..