Introduction
Like system users, users can be created also in the SQL servers. Each individual who needs access to SQL Server databases can be given a user account and permissions. Here in this blog (Create User In SQL Server Management Studio), we will demonstrate to create user in SQL for a new user to log in.
Getting Started
A login is the identity of the person or process that is connecting to an instance of SQL Server. Users need a login to connect to SQL Server. You can create a login based on a Windows principal (such as a domain user or a Windows domain group) or you can also create a login that isn't based on a Windows principal such as an SQL Server login. To use SQL Server Authentication, the Database Engine must use mixed-mode authentication.
Here we will see how to create users for the login SQL server with basic features. To create login SQL Server provides two ways one is using SQL Server Management Studio, and another is using Transact-SQL.
We will go with the first option here as the main motive of this blog but before going to SQL Server create new user steps, ensure the administrator has selected server properties with securities authentication.
Create User In SQL Server Management Studio |
Steps Of SQL Server Create User For Database
- In Object Explorer, expand the folder of the server instance in which you want to create the new login.
- Right-click the Security folder, point to New, and select Login...., the following window will appear
- In the Login - New dialog box, on the General page, enter the name of a user in the Login name box.
- To create a login that is saved on a SQL Server database, select SQL Server authentication.
- In the Password box, enter a password for the new user. Enter that password again into the Confirm Password box.
- When changing an existing password, select Specify old password, and then type the old password in the Old password box.
- To enforce password policy options for complexity and enforcement, select Enforce password policy. For more information, see Password Policy. This is a default option when SQL Server authentication is selected.
- To enforce password policy options for expiration, select Enforce password expiration. Enforce password policy must be selected to enable this checkbox. This is a default option when SQL Server authentication is selected.
- To force the user to create a new password after the first time the login is used, select User must change password at next login. Enforce password expiration must be selected to enable this checkbox. This is a default option when SQL Server authentication is selected.
- Then click the Server Roles Page, the Server Roles page lists all possible roles that can be assigned to the new login. The server role is used to grant server-wise security privileges to users, Select the required server roles. Here we will go with the public role.
- Select the User Mapping Page. Then Select the databases that this login can access. When you select a database, its valid database roles are displayed in the Database role membership for: database_name pane. Then click on the OK button
- Again, go to object explorer and right click on the SQL Server name-> click on the property. On the server property window, Select the Permissions-> Select to grant this permission to the login -> Click on the OK button.
he following options are available for server role.
- bulkadmin check box Members of the bulkadmin fixed server role can run the BULK INSERT statement.
- dbcreator check box Members of the dbcreator fixed server role can create, alter, drop, and restore any database.
- diskadmin check box Members of the diskadmin fixed server role can manage disk files.
- processadmin check box Members of the processadmin fixed server role can terminate processes running in an instance of the Database Engine.
- public check box All SQL Server users, groups, and roles belong to the public fixed server role by default.
- securityadmin check box Members of the securityadmin fixed server role manage logins and their properties. They can GRANT, DENY, and REVOKE server-level permissions. They can also GRANT, DENY, and REVOKE database-level permissions. Additionally, they can reset passwords for SQL Server logins.
- serveradmin check box Members of the serveradmin fixed server role can change server-wide configuration options and shut down the server.
- setupadmin check box Members of the setupadmin fixed server role can add and remove linked servers, and they can execute some system stored procedures.
- sysadmin check box Members of the sysadmin fixed server role can perform any activity in the Database Engine.
Summary
In the above of this blog Create User In SQL Server Management Studio, we learned to create sql server authentication login. I hope the above helped you create a new user in SQL Server.
Related Articles
- Create A Database in SQL Server
- Recover SQL Databases from Suspect Mode in SQL Server
- SQL Sever Firewall Ports
- SQL Server Shrink Log File
- Shrink Database (SQL Server)
Thanks