MS SQL Server: Check to see if a user can execute a stored procedure

前端 未结 3 1792
北荒
北荒 2020-12-16 23:17

How can you check to see if a user can execute a stored procedure in MS SQL server?

I can see if the user has explicit execute permissions by connecting to the maste

3条回答
  •  离开以前
    2020-12-17 00:05

    Assuming the SP only runs a SELECT statement:

    EXECUTE AS USER = [User's ID/Login]
    EXEC sp_foobar( sna, fu)
    REVERT

    It's important to note that you will need to run the REVERT command after the prompt as SQL Server will regard you as the user you are EXECUTING AS until you either shut down the connection or REVERT the impersonation. That said, you should see exactly what a user would get (getting some rows but not all? This should help you out).

提交回复
热议问题