Which Transact-SQL statement should you use?

You administer a Microsoft SQL Server 2012 database named Contoso that contains a single userdefined database role namedBillingUsers.
All objects in Contoso are in the dbo schema.
You need to grant EXECUTE permission for all stored procedures in Contoso to BillingUsers.
Which Transact-SQL statement should you use?

You administer a Microsoft SQL Server 2012 database named Contoso that contains a single userdefined database role namedBillingUsers.
All objects in Contoso are in the dbo schema.
You need to grant EXECUTE permission for all stored procedures in Contoso to BillingUsers.
Which Transact-SQL statement should you use?

A.
CREATE ROLE proc_caller
GRANT EXECUTE ON Schema: : dbo TO proc_caller
ALTER ROLE proc_caller ADD MEMBER BillingUsers

B.
GRANT EXECUTE ON INFORMATION_SCHEMA.ROUTINES TO BillingUsers

C.
EXEC sp_addrolemember ‘executor’, ‘BillingUsers’

D.
CREATE ROLE proc_caller
GRANT EXECUTE ON ALL PROCEDURES TO proc_caller
ALTER MEMBER BillingUsers ADD TO ROLE proc_caller



Leave a Reply 5

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


gri yer

gri yer

I personally believe A is correct.

Rafael DBA

Rafael DBA

For sure is A.

Theres no sintax for “on all precedures to…”

Try it on SQL server:

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword ‘TO’.
Msg 343, Level 15, State 1, Line 3
Unknown object type ‘MEMBER’ used in a CREATE, DROP, or ALTER statement.

Dan

Dan

A
you can alter Role not a member

Hai Dang

Hai Dang

A is correct. Could you please to copy A and D on SQL server and exec??? Tested!