You can create common users in the user database that you created, but not in the system database. This document describes how to create and manage users in a database of ApsaraDB for SQL Server by using SQL commands.
|The operation described in this document is applicable only to instances of RDS SQL Server 2012 and later versions.|
You have created a user database. For information about the commands used to create a database, see Database management of SQL Server instances.
You have created a LOGIN user and logged on to the database where you plan to create a common user. For information about the commands used to create a LOGIN user, see LOGIN user management of SQL Server instances.
Create a user
Run the following command to create a user in the database named TestDB:
USE TestDB Go CREATE USER [Test] FOR LOGIN [Test]
Modify user information
Modify user information in accordance with the corresponding operation instructions of SQL Server. For example, you can run the following command to modify user-mapped logon information:
USE TestDB GO ALTER USER test WITH LOGIN=test
Delete a user
Run the following command to delete a user (the operation is the same as that on SQL Server):
USE TestDB GO DROP USER test