70-458 · Question #112
You administer a Windows Azure SQL Database database named Inventory that contains a stored procedure named p_AddInventory. Users need to be able to SELECT from all tables in the database and…
The correct answer is A. Add EXECUTE AS OWNER to the stored procedure. Add all users to the db_datareader role. In SQL Server you can define the execution context of the following user- defined modules: functions (except inline table-valued functions), procedures, queues, and triggers. By specifying the context in which the module is executed, you can control which user account the…
Question
Options
- AAdd EXECUTE AS OWNER to the stored procedure. Add all users to the db_datareader role.
- BAdd all users to the db_datawriter role. Add all users to the db_datareader role.
- CCreate a new database role. Grant EXECUTE permission on p_AddInventory to the newrole.
- DCreate a new database role. Grant EXECUTE permission on p_AddInventory to the new role.
How the community answered
(32 responses)- A72% (23)
- B9% (3)
- C3% (1)
- D16% (5)
Explanation
In SQL Server you can define the execution context of the following user- defined modules: functions (except inline table-valued functions), procedures, queues, and triggers. By specifying the context in which the module is executed, you can control which user account the Database Engine uses to validate permissions on objects that are referenced by the module. This provides additional flexibility and control in managing permissions across the object chain that exists between user-defined modules and the objects referenced by those modules. Permissions must be granted to users only on the module itself, without having to grant them explicit permissions on the referenced objects. Only the user that the module is running as must have permissions on the objects accessed by the module.
Topics
Community Discussion
No community discussion yet for this question.