Ways to log in database on MS SQL Server
Logging in is a simple way to access SQL Server, as well as using your ID and password to log in to Windows or your email account. SQL Server has 4 types of login.
- According to Windows login information
- Specified specifically for SQL Server
- Created under Certificate certificate
- Created by Asymmetric Keys
This tutorial will only focus on how to log in with Windows Credentials and specify it for SQL Server.
Method 1 helps you log into SQL Server with your Windows username and password. If you want to create another username and password, use the second method.
To create, change or delete SQL Server login information, there are two ways
- Use SQL Server Management Studio
- Use T-SQL
Method 1: Log in to the database using SQL Server Management Studio
Step 1 : After connecting to SQL Server Instance, open the Logins folder as shown in the image below.
Ways to log in database on MS SQL Server Picture 1
Open the Logins folder on SQL Server Management Studio
Step 2: Right-click Logins and select Newlogin, the screen below will appear.
Ways to log in database on MS SQL Server Picture 2
Enter login information
Step 3: Enter the name and password, confirm the password again as shown in the image above and click OK. Then, new login information will be created as shown in the image below.
Ways to log in database on MS SQL Server Picture 3
New login information created
Method 2: Log in the database using T-SQL Script
To create a login name of TestLogin and a password of P @ ssword, you only need to run 2 queries below.
Create login yourloginname with password='yourpassword'
Create login TestLogin with password='P@ssword'
Previous article: Managing MS SQL Server with Management Studio
Next article: How to create a database on MS SQL Server
You should read it
- ALTER LOGIN command in SQL Server
- Find Login in SQL Server
- CREATE LOGIN command in SQL Server
- DROP LOGIN command in SQL Server
- How to recover the database in MS SQL Server
- What is MS SQL Server?
- Database monitoring in MS SQL Server
- SQL Server 2019 - Microsoft Relational Database Management System
- How to Unlock SQL Server Account
- Instructions for installing SQL Server 2019
- SQL Server setup is always available
- Use the ALTER DATABASE command to migrate DATABASE in SQL Server