locked
SQL Server 2014 - Query for seeing what stored procedures have excute rights RRS feed

  • Question

  • User-1188570427 posted

    Is there a query that I can run as a regular user (not sys admin) that will tell me if the store procedures in my database have execute permissions or not?

    Thursday, May 12, 2016 1:34 PM

Answers

  • User-219423983 posted

    Hi tvb2727,

    Is there a query that I can run as a regular user (not sys admin) that will tell me if the store procedures in my database have execute permissions or not?

    You could try to refer to below code that comes from this similar thread to achieve your need.

    EXECUTE AS USER = 'username';
    SELECT * FROM fn_my_permissions('[storedProcedureSchema].[storedProcedureName]', 'OBJECT') 
        where permission_name = 'EXECUTE'
        ORDER BY subentity_name, permission_name ;  
    REVERT;
    

    Best Regards, <!--?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" /--><o:p></o:p>

    Weibo Zhang<o:p></o:p>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 13, 2016 1:42 AM