
- MS SQL Server
- MS SQL Server - Home
- MS SQL Server - Overview
- MS SQL Server – Editions
- MS SQL Server – Installation
- MS SQL Server – Architecture
- MS SQL Server – Managment Studio
- MS SQL Server – Login Database
- MS SQL Server - Create Database
- MS SQL Server - Select Database
- MS SQL Server - Drop Database
- MS SQL Server - Creating Backups
- MS SQL Server - Restoring Databases
- MS SQL Server - Create Users
- MS SQL Server - Assign Permissions
- MS SQL Server - Monitor Database
- MS SQL Server - Services
- MS SQL Server - HA Technologies
- MS SQL Server - Reporting services
- MS SQL Server - Execution Plans
- MS SQL Server - Integration Services
- MS SQL Server - Analysis Services
- MS SQL Server Useful Resources
- MS SQL Server - Quick Guide
- MS SQL Server - Useful Resources
- MS SQL Server - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MS SQL Server - Create Users
User refers to an account in MS SQL Server database which is used to access database.
Users can be created using either of the following two methods.
Method 1 – Using T-SQL
Syntax
Create user <username> for login <loginname>
Example
To create user name 'TestUser' with mapping to Login name 'TestLogin' in TestDB database, run the following query.
create user TestUser for login TestLogin
Where 'TestLogin' is the login name which was created as part of the Login creation
Method 2 – Using SSMS (SQL Server Management Studio)
Note − First we have to create Login with any name before creating a user account.
Let’s use Login name called 'TestLogin'.
Step 1 − Connect SQL Server and expand databases folder. Then expand database called 'TestDB' where we are going to create the user account and expand the security folder. Right-click on users and click on the new user to see the following screen.

Step 2 − Enter 'TestUser' in the user name field and click on ellipse to select the Login name called 'TestLogin' as shown in the following snapshot.

Step 3 − Click OK to display login name. Again click OK to create 'TestUser' user as shown in the following snapshot.
