Is it possible to give developers read only access to stored procedure contents?

Is it possible to give developers read only access to stored procedure contents?

Is it possible to set up SQL Server to give developers read-only access to the contents of stored procedures on our production database? You can grant them the VIEW DEFINITION privilege to those procs. See here for what this privilege does. You can apply VIEW DEFINITION at different scopes:

How to check stored procedures in SQL Server?

This does the above without having to run scripts. DB Name –> Security –> Users –> Right Click User name –> Properties –> select Securables –> Click Search –> select All Objects of type –> Check Stored Procedures –> Check View Definition –> OK. Thanks for contributing an answer to Stack Overflow!

How to grant view definition privilege to Procs?

You can grant them the VIEW DEFINITION privilege to those procs. See here for what this privilege does. You can apply VIEW DEFINITION at different scopes: You can also use a query to generate a script for many procs.

How to grant execute or view permission to stored procedures?

On click you’ll get a window to select user and roles, click on Browse to select users that require permission and click OK. You’ll get the following ‘Image 3’ with selected user. Click OK and you’ll get a list of permissions to apply for the user. Go to execute permission and check Grant checkbox as shown below.

How to access stored procedures in SQL Server?

Connect Server with Admin Session – Go to Database, Programmability, Stored Procedures, then select your Procedure. Right click on your procedure and select Properties. You’ll get the following window.

Can a SELECT statement be used to execute a procedure?

Even if your stored procedures are using SELECT statements, you won’t be able to execute those procedures unless you’ve permission to execute. If you’ve READ permission on database, you can read data only from Tables, Views, and Functions.