You administer a Microsoft SQL Server 2012 databasethat has Trustworthy set to On.
You create a stored procedure that returns database-level information from Dynamic Management Views.
You grant User1 access to execute the stored procedure.
You need to ensure that the stored procedure returns the required information when User1 executes the stored
procedure.
You need to achieve this goal by granting the minimum permissions required.
What should you do? (Each correct answer presents acomplete solution. Choose all that apply.)
A.
Create a SQL Server login that has VIEW SERVER STATE permissions.
Create an application role and a secured password for the role.
B.
Modify the stored procedure to include the EXECUTE AS OWNER statement.
Grant VIEW SERVER STATE permissions to the owner ofthe stored procedure.
C.
Create a SQL Server login that has VIEW SERVER STATE permissions.
Modify the stored procedure to include the EXECUTE AS {newlogin} statement.
D.
Grant the db_owner role on the database to User1.
E.
Grant the sysadmin role on the database to User1.
Explanation:
According to these references, this answer looks correct.
References:
http://msdn.microsoft.com/en-us/library/ms187861.aspx
http://msdn.microsoft.com/en-us/library/ms191291.aspx
I doubt C because of the following execute as syntax for stored procedures
{ EXEC | EXECUTE } AS { CALLER | SELF | OWNER | ‘user_name’ }
‘login_name’ can be specified only for DDL triggers with server scope or logon triggers
https://msdn.microsoft.com/en-us/library/ms188354.aspx
Check here:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/57fe3bc2-ff5e-4698-90e4-b959feb0bd25/70462-practice-question?forum=sqldocumentation