A developer named Lena must be able to read the code of the stored procedure Sales.uspGetOrders in an Azure SQL Database. Lena must not be able to run the procedure. Lena must not be able to change its definition.
You open the Permissions page of the procedure's properties in SQL Server Management Studio (SSMS) and select Lena's database user.
Which permission should you grant to Lena on Sales.uspGetOrders?
Only VIEW DEFINITION lets Lena read the procedure's code while meeting both restrictions. EXECUTE would let her run it, ALTER would let her modify it, and CONTROL gives every right on the object.
- Correct: VIEW DEFINITION. VIEW DEFINITION lets Lena read the procedure's code without also giving her the right to run or modify it.
- Not correct: ALTER. ALTER lets a user modify how the procedure is defined, which Lena must not be able to do.
- Not correct: CONTROL. CONTROL gives every right on the procedure, so Lena could also modify and run it.
- Not correct: EXECUTE. EXECUTE lets a user run the procedure, and Lena must not be able to run it.