nerdexam
Microsoft

70-465 · Question #118

Your company has a SQL Azure subscription. You implement a database named Database1. Database1 has two tables named Table1 and Table2. You create a stored procedure named sp1. Sp1 reads data from…

The correct answer is D. Grant User1 the EXECUTE permission on sp1. To enable User1 to run the stored procedure sp1, the EXECUTE permission must be granted directly on sp1, which is the minimal necessary permission.

Submitted by deeparc· Mar 5, 2026Design and implement database solutions for Azure SQL Database

Question

Your company has a SQL Azure subscription. You implement a database named Database1. Database1 has two tables named Table1 and Table2. You create a stored procedure named sp1. Sp1 reads data from Table1 and inserts data into Table2. A user named User1 informs you that he is unable to run sp1. You verify that User1 has the SELECT permission on Table1 and Table2. You need to ensure that User1 can run sp1. The solution must minimize the number of permissions assigned to User1. What should you do?

Options

  • AGrant User1 the INSERT permission on Table2.
  • BAdd User1 to the db_datawriter role.
  • CChange sp1 to run as the sa user.
  • DGrant User1 the EXECUTE permission on sp1.

How the community answered

(25 responses)
  • A
    8% (2)
  • B
    12% (3)
  • C
    4% (1)
  • D
    76% (19)

Why each option

To enable User1 to run the stored procedure sp1, the `EXECUTE` permission must be granted directly on sp1, which is the minimal necessary permission.

AGrant User1 the INSERT permission on Table2.

Granting `INSERT` permission on `Table2` alone would not allow User1 to execute `sp1`; it would only address a potential underlying permission issue if `sp1` were already runnable by User1 and executed under User1's context.

BAdd User1 to the db_datawriter role.

Adding User1 to the `db_datawriter` role is overly broad, granting INSERT, UPDATE, and DELETE permissions on all user tables, which violates the requirement to minimize permissions and does not directly grant `EXECUTE` permission on stored procedures.

CChange sp1 to run as the sa user.

Changing `sp1` to run as the `sa` user is a significant security risk, granting the procedure excessive privileges, and does not directly address how to grant User1 the ability to execute the procedure itself.

DGrant User1 the EXECUTE permission on sp1.Correct

To execute any stored procedure in SQL Azure (and SQL Server), a user must be explicitly granted the `EXECUTE` permission on that specific procedure. Granting `EXECUTE` on `sp1` directly addresses the problem of User1 being "unable to run sp1" and adheres to the principle of least privilege by assigning only the required permission for procedure invocation.

Concept tested: SQL Stored Procedure EXECUTE Permission

Source: https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-object-permissions-transact-sql?view=sql-server-ver16#EXECUTE-permissions

Topics

#Stored procedure permissions#SQL Azure security#EXECUTE permission

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice