You can create common users in the database that you created other than the system database. This document describes how to create and manage users in a database of ApsaraDB for SQL Server using SQL commands.
|The operation described in this document is applicable only to instances of RDS for 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 commands 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 commands to modify user-mapped logon information:
USE TestDB GO ALTER USER test WITH LOGIN=test
Delete a user
Run the following commands to delete a user (the operation is the same as that on SQL Server):
USE TestDB GO DROP USER test