This topic describes how to use SQL statements to create and manage users on an ApsaraDB RDS for SQL Server instance.
You can create users only in the databases that you created. You cannot create users in system databases.
Prerequisites
The RDS instance runs SQL Server 2012 or later.
A user database is created. For more information, see Create and manage databases by using SQL statements.
A login is created and is used to log on to the database in which you want to create a user. For more information, see Manage logins.
Create a user
Execute the following statements to create a user in the TestDB database:
USE TestDB
GO
CREATE USER [Test] FOR LOGIN [Test]
Modify the user information
Execute the following statements to modify user information. The process is similar to the process in SQL Server.
USE TestDB
GO
ALTER USER test WITH LOGIN=test
Delete a user
Execute the following statements to delete a user. The process is similar to the process in SQL Server.
USE TestDB
GO
DROP USER test