Tuesday, August 5, 2014

SQL Server: Execute rights on all stored procedures in a database

I’m currently working on an application deployment. One of the things I had to configure was the database security settings. To minimize the attack surface I created a SQL Server user with only the necessary rights(and nothing more). The annoying things is that the application I have to deploy is full of stored procedures.

I started with giving the SQL login ‘EXECUTE’ permissions on every individual stored procedure but this was really cumbersome. There should be a better way…

And of course there is, use the following SQL command to grant a user ‘EXECUTE’ permissions on all stored procedures(even ones you add later):

No comments: