T-SQL: Give views permissions to all stored procedures

You can use the T-SQL code below within your database to give permissions to ‘MYUSER’ for viewing all stored procedures. (of course, replace “MYUSER” with your own user)

Once executed, you can copy and paste the output to a new query window an execute it.

select 'GRANT VIEW DEFINITION ON ' + quotename(specific_schema) 
+ '.' + quotename(specific_name)
+ ' TO ' + 'MYUSER'
  from INFORMATION_SCHEMA.routines
where routine_type = 'PROCEDURE'
Share your love