How To Create SQL Server Login
In this article “How to create login in SQL Server”, we will learn how we can create SQL Server Login on Server level with examples. Here screenshot of each step also shown as below.
Creating SQL Server Login
SQL Server Login is used to provide Server level access and permissions. Further that login can also be associated with specific users and grant them whole/partial permission to work with all or specific database(s).
By default public server role is granted to the login. The public server role can not be changed.
Step-I: Open SQL Server Management Studio and click on Connect button.
Step-II: Right click on Security, move the cursor on New tab and then click on Login… button from the pop-up window as shown in the below image.
Expand Security tab by clicking on the + icon, and Right click on Logins, and click on New Login… button.
Step-III: A login window will open as below.
Step-IV: Follow the steps below
- Provide the login name
- Choose Windows Authentication or
- SQL Server authentication and provide the password
- Keep the checkboxes checked if you wish to Enforce password policy, password expiration and change of password at next login.
- Choose the Default Database and Default language.
- Click OK button.
SQL Server login created successfully.
You can check the created login by expanding the Security and Login tab as shown below.
Keep in your mind, that we simply created a login without assigning Server Role(Except public), User Mappings, Securables and changing Status.
So, we can only login SQL Server Management Studio by providing the role created and password. But nothing can be done with these credentials.
A new window will be shown for changing password, because we didn’t unchecked the checkboxes as show in Step-IV image.
Provide the New Password and Confirm Password and Click on OK button.
Your SQL Server instance will be logged in with the login that we created.
Since, we created SQL Server login with public Server role only and didn’t associated this login to any database and database role. So, we can’t do anything with this login only.