DP-300 · Question #87
Drag and Drop Question You have an Azure SQL Database instance named DatabaseA on a server named Server1. You plan to add a new user named App1 to DatabaseA and grant App1 db_datacenter permissions…
The correct answer is On the master database, run CREATE LOGIN [App1] WITH PASSWORD = 'P@aaWord!'.; On DatabaseA, run CREATE USER [App1] FROM LOGIN [App1].; On DatabaseA, run ALTER ROLE db_datareader ADD MEMBER [App1]. The correct sequence is: (1) Create a SQL Server login on the master database using 'CREATE LOGIN [App1] WITH PASSWORD', which establishes server-level credentials that can be reused across multiple databases. (2) Create a user in DatabaseA mapped to that login using 'CREATE…
Question
Exhibit
Answer Area
Drag items
Correct arrangement
- On the master database, run CREATE LOGIN [App1] WITH PASSWORD = 'P@aaWord!'.
- On DatabaseA, run CREATE USER [App1] FROM LOGIN [App1].
- On DatabaseA, run ALTER ROLE db_datareader ADD MEMBER [App1];
Explanation
The correct sequence is: (1) Create a SQL Server login on the master database using 'CREATE LOGIN [App1] WITH PASSWORD', which establishes server-level credentials that can be reused across multiple databases. (2) Create a user in DatabaseA mapped to that login using 'CREATE USER [App1] FROM LOGIN [App1]', linking the database user to the server-level login. (3) Grant the role using 'ALTER ROLE db_datareader ADD MEMBER [App1]' to assign the appropriate permissions. This approach satisfies the requirement that App1 can access other databases using the same credentials, because a server-level login (not a contained database user) is portable across databases on the same server.
Topics
Community Discussion
No community discussion yet for this question.
