Skip to content

Commit b6ba87b

Browse files
authored
Merge pull request #34568 from VanMSFT/20250630_FreshnessPass1
Refreshing articles 1
2 parents 92cd5e1 + 3289d3a commit b6ba87b

File tree

8 files changed

+187
-170
lines changed

8 files changed

+187
-170
lines changed

docs/relational-databases/partitions/partitioned-tables-and-indexes.md

Lines changed: 92 additions & 93 deletions
Large diffs are not rendered by default.

docs/relational-databases/security/authentication-access/create-a-database-user.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: "Create a database user"
2+
title: "Create a Database User"
33
description: Learn how to create the most common types of database users by using SQL Server Management Studio or Transact-SQL.
44
author: VanMSFT
55
ms.author: vanto
66
ms.reviewer: randolphwest
7-
ms.date: 07/18/2024
7+
ms.date: 06/30/2025
88
ms.service: sql
99
ms.subservice: security
1010
ms.topic: how-to
@@ -38,15 +38,15 @@ You can create a database user by using [!INCLUDE [ssManStudioFull](../../../inc
3838

3939
[!INCLUDE [ssManStudio](../../../includes/ssmanstudio-md.md)] presents six options when creating a database user. The following diagram shows the six options in the green box, and indicates what they represent.
4040

41-
:::image type="content" source="media/typesofusers.png" alt-text="Diagram that explains the different types of users.":::
41+
:::image type="content" source="media/create-a-database-user/types-of-users.png" alt-text="Diagram that explains the different types of users.":::
4242

4343
### Select the type of user
4444

4545
If you're new to [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)], it can be difficult to determine what type of user you want to create. First ask yourself, does the person or group that needs to access the database have a login?
4646

4747
#### Create a user with a login
4848

49-
Logins in the `master` database are common for the people who manage the [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] and for people who need to access many or all of the database on the instance of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)]. For this situation, create a **SQL user with login**. The database user is the identity of the login when it connects to a database. The database user can use the same name as the login, but that isn't required. This article assumes that a login already exists in [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)]. For information about how to create a login, see [Create a Login](create-a-login.md).
49+
Logins in the `master` database are common for the people who manage the [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] and for people who need to access many or all of the database on the instance of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)]. For this situation, create a **SQL user with login**. The database user is the identity of the login when it connects to a database. The database user can use the same name as the login, but that isn't required. This article assumes that a login already exists in [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)]. For information about how to create a login, see [Create a login](create-a-login.md).
5050

5151
#### Create user without a login
5252

@@ -75,7 +75,9 @@ As a security principal, permissions can be granted to users. The scope of a use
7575

7676
Requires `ALTER ANY USER` permission on the database.
7777

78-
## <a id="SSMSProcedure"></a> Create a user with SSMS
78+
<a id="SSMSProcedure"></a>
79+
80+
## Create a user with SSMS
7981

8082
1. In Object Explorer, expand the **Databases** folder.
8183

@@ -158,7 +160,9 @@ The **Database User - New** dialog box also offers options on four other pages:
158160

159161
Removes the selected extended property.
160162

161-
## <a id="TsqlProcedure"></a> Create a user using T-SQL
163+
<a id="TsqlProcedure"></a>
164+
165+
## Create a user using T-SQL
162166

163167
1. In **Object Explorer**, connect to an instance of [!INCLUDE [ssDE](../../../includes/ssde-md.md)].
164168

@@ -183,5 +187,5 @@ For more information, see [CREATE USER](../../../t-sql/statements/create-user-tr
183187
## Related content
184188

185189
- [Principals (Database Engine)](principals-database-engine.md)
186-
- [Create a Login](create-a-login.md)
190+
- [Create a login](create-a-login.md)
187191
- [CREATE LOGIN (Transact-SQL)](../../../t-sql/statements/create-login-transact-sql.md)

docs/relational-databases/security/authentication-access/create-a-login.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
title: "Create a login"
2+
title: "Create a Login"
33
description: Learn how to create a login in SQL Server or Azure SQL by using SQL Server Management Studio or Transact-SQL.
44
author: VanMSFT
55
ms.author: vanto
6-
ms.date: 09/11/2024
6+
ms.date: 06/30/2025
77
ms.service: sql
88
ms.subservice: security
99
ms.topic: how-to
10+
ms.custom:
11+
- build-2025
1012
f1_keywords:
1113
- "sql13.swb.login.status.f1"
1214
- "sql13.swb.login.effectivepermissions.f1"
@@ -20,8 +22,6 @@ helpviewer_keywords:
2022
- "Create login [SQL Server]"
2123
- "SQL Server logins"
2224
monikerRange: ">=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current"
23-
ms.custom:
24-
- build-2025
2525
---
2626
# Create a login
2727

@@ -31,14 +31,16 @@ This article describes how to create a login in [!INCLUDE [ssnoversion](../../..
3131

3232
[!INCLUDE [entra-id](../../../includes/entra-id.md)]
3333

34-
## <a name="Background"></a> Background
34+
<a id="Background"></a>
35+
36+
## Background
3537

3638
A login is a security principal, or an entity that can be authenticated by a secure system. Users need a login to connect to [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)]. You can create a login based on a Windows principal (such as a domain user or a Windows domain group) or you can create a login that isn't based on a Windows principal (such as an [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] login).
3739

3840
[!INCLUDE [encryption-algorithm-history-md](../../../includes/encryption-algorithm-history.md)]
3941

4042
> [!NOTE]
41-
> To use [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] Authentication, the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] must use mixed mode authentication. For more information, see [Choose an Authentication Mode](../../../relational-databases/security/choose-an-authentication-mode.md).
43+
> To use [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] Authentication, the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] must use mixed mode authentication. For more information, see [Choose an authentication mode](../choose-an-authentication-mode.md).
4244
>
4345
> Azure SQL has introduced [Microsoft Entra server principals (logins)](/azure/azure-sql/database/authentication-azure-ad-logins) to be used to authenticate to Azure SQL Database, Azure SQL Managed Instance, and Azure Synapse Analytics (dedicated SQL pools only).
4446
>
@@ -47,15 +49,19 @@ A login is a security principal, or an entity that can be authenticated by a sec
4749
As a security principal, permissions can be granted to logins. The scope of a login is the whole [!INCLUDE [ssDE](../../../includes/ssde-md.md)]. To connect to a specific database on the instance of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)], a login must be mapped to a database user. Permissions inside the database are granted and denied to the database user, not the login. Permissions that have the scope of the whole instance of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] (for example, the **CREATE ENDPOINT** permission) can be granted to a login.
4850

4951
> [!NOTE]
50-
> When a login connects to [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)], the identity is validated at the `master` database. Use contained database users to authenticate [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] and [!INCLUDE [ssSDS](../../../includes/sssds-md.md)] connections at the database level. When using contained database users, a login is not necessary. A contained database is a database that is isolated from other databases and from the instance of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] or [!INCLUDE [ssSDS](../../../includes/sssds-md.md)] (and the `master` database) that hosts the database. [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] supports contained database users for both Windows and [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] authentication. When using [!INCLUDE [ssSDS](../../../includes/sssds-md.md)], combine contained database users with database level firewall rules. For more information, see [Contained Database Users - Making Your Database Portable](../../../relational-databases/security/contained-database-users-making-your-database-portable.md).
52+
> When a login connects to [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)], the identity is validated at the `master` database. Use contained database users to authenticate [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] and [!INCLUDE [ssSDS](../../../includes/sssds-md.md)] connections at the database level. When using contained database users, a login is not necessary. A contained database is a database that is isolated from other databases and from the instance of [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] or [!INCLUDE [ssSDS](../../../includes/sssds-md.md)] (and the `master` database) that hosts the database. [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] supports contained database users for both Windows and [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] authentication. When using [!INCLUDE [ssSDS](../../../includes/sssds-md.md)], combine contained database users with database level firewall rules. For more information, see [Make your database portable by using contained databases](../contained-database-users-making-your-database-portable.md).
5153
52-
## <a name="Permissions"></a> Permissions
54+
<a id="Permissions"></a>
55+
56+
## Permissions
5357

5458
[!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] requires **ALTER ANY LOGIN** or **ALTER LOGIN** permission on the server, or the **##MS_LoginManager##** fixed server role (SQL Server 2022 and later).
5559

5660
[!INCLUDE [ssSDS](../../../includes/sssds-md.md)] requires membership in the **loginmanager** role or the fixed server role, **##MS_LoginManager##**.
5761

58-
## <a name="SSMSProcedure"></a> Create a login using SSMS for SQL Server
62+
<a id="SSMSProcedure"></a>
63+
64+
## Create a login using SSMS for SQL Server
5965

6066
1. In Object Explorer, expand the folder of the server instance in which you want to create the new login.
6167

@@ -86,7 +92,7 @@ As a security principal, permissions can be granted to logins. The scope of a lo
8692

8793
1. When changing an existing password, select **Specify old password**, and then type the old password in the **Old password** box.
8894

89-
1. To enforce password policy options for complexity and enforcement, select **Enforce password policy**. For more information, see [Password Policy](../../../relational-databases/security/password-policy.md). This is a default option when **SQL Server authentication** is selected.
95+
1. To enforce password policy options for complexity and enforcement, select **Enforce password policy**. For more information, see [Password Policy](../password-policy.md). This is a default option when **SQL Server authentication** is selected.
9096

9197
1. 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.
9298

@@ -96,7 +102,7 @@ As a security principal, permissions can be granted to logins. The scope of a lo
96102

97103
1. To associate the login with a stand-alone asymmetric key, select **Mapped to asymmetric key** to, and then select the name of an existing key from the list.
98104

99-
1. To associate the login with a security credential, select the **Mapped to Credential** check box, and then either select an existing credential from the list or select **Add** to create a new credential. To remove a mapping to a security credential from the login, select the credential from **Mapped Credentials** and select **Remove**. For more information about credentials in general, see [Credentials (Database Engine)](../../../relational-databases/security/authentication-access/credentials-database-engine.md).
105+
1. To associate the login with a security credential, select the **Mapped to Credential** check box, and then either select an existing credential from the list or select **Add** to create a new credential. To remove a mapping to a security credential from the login, select the credential from **Mapped Credentials** and select **Remove**. For more information about credentials in general, see [Credentials (Database Engine)](credentials-database-engine.md).
100106

101107
1. From the **Default database** list, select a default database for the login. `master` is the default for this option.
102108

@@ -165,7 +171,7 @@ Specifies the default schema of the user. When a user is first created, its defa
165171
Read-only attribute indicating whether the Guest account is enabled on the selected database. Use the **Status** page of the **Login Properties** dialog box of the Guest account to enable or disable the Guest account.
166172

167173
**Database role membership for:** _database_name_
168-
Select the roles for the user in the specified database. All users are members of the **public** role in every database and can't be removed. For more information about database roles, see [Database-Level Roles](../../../relational-databases/security/authentication-access/database-level-roles.md).
174+
Select the roles for the user in the specified database. All users are members of the **public** role in every database and can't be removed. For more information about database roles, see [Database-level roles](database-level-roles.md).
169175

170176
### Securables
171177

@@ -242,7 +248,9 @@ Select this option to enable or disable this login. This option uses the `ALTER
242248
**SQL Server authentication**
243249
The check box **Login is locked out** is only available if the selected login connects using [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] authentication and the login has been locked out. This setting is read-only. To unlock a login that is locked out, execute `ALTER LOGIN` with the UNLOCK option.
244250

245-
## <a name="TsqlProcedure"></a> Create a login using Windows authentication with T-SQL
251+
<a id="TsqlProcedure"></a>
252+
253+
## Create a login using Windows authentication with T-SQL
246254

247255
1. In **Object Explorer**, connect to an instance of [!INCLUDE [ssDE](../../../includes/ssde-md.md)].
248256

@@ -275,17 +283,19 @@ The check box **Login is locked out** is only available if the selected login co
275283
GO
276284
```
277285

278-
For more information, see [CREATE LOGIN (Transact-SQL)](../../../t-sql/statements/create-login-transact-sql.md).
286+
For more information, see [CREATE LOGIN](../../../t-sql/statements/create-login-transact-sql.md).
287+
288+
<a id="FollowUp"></a>
279289

280-
## <a name="FollowUp"></a> Follow up: Steps to take after you create a login
290+
## Follow up: Steps to take after you create a login
281291

282292
The login can connect to [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] after creating a login, but doesn't necessarily have sufficient permission to perform any useful work. The following list provides links to common login actions.
283293

284-
- To have the login join a role, see [Join a Role](../../../relational-databases/security/authentication-access/join-a-role.md).
294+
- To have the login join a role, see [Join a Role](join-a-role.md).
285295

286-
- To authorize a login to use a database, see [Create a Database User](../../../relational-databases/security/authentication-access/create-a-database-user.md).
296+
- To authorize a login to use a database, see [Create a database user](create-a-database-user.md).
287297

288-
- To grant a permission to a login, see [Grant a Permission to a Principal](../../../relational-databases/security/authentication-access/grant-a-permission-to-a-principal.md).
298+
- To grant a permission to a login, see [Grant a Permission to a Principal](grant-a-permission-to-a-principal.md).
289299

290300
## Related content
291301

41.2 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)