Which Transact-SQL statements should you execute?

You administer a SQL Server 2008 instance. A database developer named User1 views the
definitions of all database objects in a database to read data from all user-defined tables,
views, and table-valued functions. You need to set the required permissions for User1. You
also need to ensure that the same permissions can be granted to other developers by
executing minimum number of Transact-SQL statements. Which Transact-SQL statements
should you execute?

You administer a SQL Server 2008 instance. A database developer named User1 views the
definitions of all database objects in a database to read data from all user-defined tables,
views, and table-valued functions. You need to set the required permissions for User1. You
also need to ensure that the same permissions can be granted to other developers by
executing minimum number of Transact-SQL statements. Which Transact-SQL statements
should you execute?

A.
GRANT VIEW ANY DEFINITION TO User1;EXEC sp_addrolemember ‘db_datareader’,
‘User1’;

B.
CREATE ROLE Developers;GRANT CONTROL TO Developers;EXEC
sp_addrolemember ‘Developers’, ‘User1’;

C.
CREATE ROLE Developers;GRANT VIEW DEFINITION TO Developers;GRANT
SELECT TO Developers;EXEC sp_addrolemember ‘Developers’. ‘User1’;

D.
CREATE ROLE Developers;EXEC sp_addrolemember ‘sp_dbdatareader’.
‘Developers’;EXEC sp_addrolemember ‘sp_dbddladmin\ ‘Developers’;EXEC
sp_addrolemember ‘Developers’, ‘User1’;



Leave a Reply 0

Your email address will not be published. Required fields are marked *