MS SQL Server - Create users
User refers to an account in MS SQL Server database which is used to access the database.
Users can be created using one of the following two methods.
Method 1 - Using T-SQL
Create user for login
To create the username 'TestUser ' with the mapping to the login name 'TestLogin ' in the TestDB database, run the query next.
create user TestUser for TestLogin connection
Where 'TestLogin ' is the connection name that was created as part of creating the connection
Method 2 - Using SSMS (SQL Server Management Studio)
Note - We must first create a connection with n 'importantte what name before creating a user account.
Let's use the login name called 'TestLogin '.
Step 1 - Connect SQL Server and expand the databases folder. Then expand the database called 'TestDB ' where we will create the user account and expand the security folder. Right click on the users and click on the new user to see the following screen.
Step 2 - Enter 'TestUser ' in the name field 'user and click ellipse to select the login name called ' TestLogin 'as shown in the following snapshot.
Step 3 - Click OK to display the login name. Click OK again to create the 'TestUser ' as shown in the 'next snapshot.