How to create users in MS SQL Server
The user here is an account on MS SQL Server to access the database (database).
Users can be created in 1 of 2 ways below.
Method 1: Use T-SQL
Syntax for creating users in MS SQL Server.
Create user for login
For example:
To create a user named TestUser with the login name TestLogin on TestDB database , run the query below.
create user TestUser for login TestLogin
Method 2: Use SQL Server Management Studio SSMS
Note: First, you need to create Login with any name before creating user account. Use Login as TestLogin.
Step 1 : Connect to SQL Server and expand the database directory. Then open the database named TestDB, where we will create user accounts, find the Security folder . Find the Users or Logins folder (on the new SQL Server version) and select New Login. Then the screen below will appear.
New user creation screen for MS SQL Server
Step 2: Enter the TestUser name for the username and select the Login name named TestLogin as shown below.
Create a new user account
Step 3: Click OK to finish. Refresh the folder, you will see the newly created username.
Successfully created new users on MS SQL Server
Previous article: How to recover the database in MS SQL Server
Next lesson: How to decentralize access in MS SQL Server
You should read it
- The CREATE USER command in SQL Server
- FUNCTION (Function) in SQL Server
- VIEW in SQL Server
- Instructions for setting up and managing FTP Server on Windows 10
- The difference between web server and app server
- Install Windows Server 2003 and create a backup server
- PROCEDURE (Procedure) in SQL Server
- How to create a VPN server on Windows without using software?
May be interested
- How to create a VPN server on Windows without using software?windows integrates functionality as a vpn server even if this option is hidden. this trick applies to both windows 7 and windows 8. this server uses tunneling protocols from point to point.
- VIEW in SQL Serverthe article explains how to create, update and delete view in sql server with syntax and examples.
- How to set up your own email server on Windows PCtoday, almost all popular web-mail providers, including gmail, yahoo and outlook, regularly scan users' email, which is big data. so should lovers and privacy promotion surrender to the power of big data companies?
- Transfer from Linux Mail Server to Exchange Server 2007 (Part 2)in this article we will create an email address policy to apply to new users and will create users based on the linux passwd file.
- How to connect to an FTP Server from Windows Explorer?windows allows users to easily connect to an ftp server and the shared ftp folder using add network location wizard. after running the wizard, you can easily manage (copy, move, delete, create or rename ...) all content on ftp server from windows explorer.
- PROCEDURE (Procedure) in SQL Serverprocedure is a program in the database that contains many statements that you save for later use but have different points from function. the article will give you the syntax and examples of how to create and delete procedures in sql server.
- The CREATE USER command in SQL Serverthis article will show you in detail how to use the create user command in sql server, with specific syntax and examples to better visualize and capture commands.
- CREATE LOGIN command in SQL Serverthe article explains how to use the create login command with syntax and examples.
- CREATE TABLE command in SQL Serverin sql server (transact-sql), the create table statement is used to create and define tables.
- How to create your own online proxy server in minutesin some cases, none of the regular proxy servers worked, and even google translate didn't work.