Check Execute Permissions on all Stored procs for a user

  • How to verify whether a user has EXECUTE permissions on all stored procedures in a database?

    Or display Stored procedures that are not having EXECUTE permissions for that user in a database.

  • In Query Analyzer:  SP_HELPROTECT NULL, 'user'

    In Enterprise Manager:  Expand the database, expand Users, right-click on a user, select All Tasks, select Manage Permissions

    Greg

    Greg

  • SP_HELPROTECT NULL, 'user'  doesn't give the information like the whether the stored procedure has execute permissions or not.

    I need the information like stored procedures not containing execute permissions for a particular user.

  • Sorry about that.  You're supposed to replace 'user' with the username that you're interested in.  You can see the syntax in BOL.

    As for your second question, try this query:

    select name

    from sysobjects o

    where o.xtype = 'P'

    and o.id not in (select p.id from sysprotects p

                join sysusers u on p.uid = u.uid

       where u.name = 'user' and p.action = 224)

    Replace 'user' with a real database user.

    Greg

    Greg

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

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