Grant Execute on ALL procs in a Database

  • I see a lot of old, 10+ year old posts for SQL 2000, 2005 etc on this.    For our SQL 2019 environment, what is the easiest most efficient way to:

    GRANT EXECUTE on ALL StoredProcedures in DB_XYZ to MyDomainUser (eg. MyDomain\User_1)

    thx for any feedback!

    BT
  • USE [DB_XYZ];

    GRANT EXEC TO [MyDomain\User_1]

    That includes system procs, of course.  If you prefer, you can do this:

    GRANT EXEC ON SCHEMA::dbo TO [MyDomain\User_1]

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • I'd go one farther. Set up database security so that you have groups. Grant security to the groups. Add/remove logins or groups of logins with the groups. It makes security management so much easier, yet still extremely safe.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply