Grant View Definition for All Stored Procedures



  • What is the approach to granting a user the ability to view all stored procedures across all schemas?


    The command such as

    GRANT VIEW DEFINITION ON [dbo].[{SprocNameHere}] TO [{UserNameHere}] 
    

    is a one trick pony and has to be done in for all sprocs. Is there a more generic way to include all?



  • You can grant at a schema scope

    GRANT VIEW DEFINITION ON SCHEMA::DBO TO SOMEUSER
    

    or the whole database

    GRANT VIEW DEFINITION TO SOMEUSER
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2