Topic 2, Manage databases and instances
HOTSPOT
You need to ensure that a user named Admin2 can manage logins.
How should you complete the Transact-SQL statements? To answer, select the appropriate Transact-SQL segments in the answer area.
Answer:
Explanation:
Step 1: CREATE LOGIN
First you need to create a login for SQL Azure, it’s syntax is as follows:
CREATE LOGIN username WITH password=’password’;
Step 2, CREATE USER
Step 3: LOGIN
Users are created per database and are associated with logins. You must be connected to the database in where you want to create the user. In most cases, this is not the master database. Here is some sample Transact-SQL that creates a user:
CREATE USER readonlyuser FROM LOGIN readonlylogin;
Step 4: loginmanager
Members of the loginmanager role can create new logins in the master database.
References:
https://azure.microsoft.com/en-us/blog/adding-users-to-your-sql-azure-database/
https://docs.microsoft.com/en-us/azure/sql-database/sql-database-manage-logins
Leave a Reply