PdfPrep.com

Which statement should you execute first?

You have a SQL Server instance that uses database roles. The instance contains two databases named Customers and Sales.

A user named User1 has the required roles to access Customers. You need to ensure that User1 can access Sales.

Which statement should you execute first?
A . ALTER ROLE…ADD MEMBER
B . CREATE USER
C . CREATE LOGIN
D . ALTER SERVER ROLE…ADD MEMBER

Answer: A

Explanation:

The ALTER ROLE…ADD MEMBER command adds or removes members to or from a database role.

Example: This example creates a database role named Sales. It adds a database user named Barry to the membership.

CREATE ROLE Sales; ALTER ROLE Sales ADD MEMBER Barry;

References: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-role-transact-sql

Exit mobile version