# Types of MSSQL Users

{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/files/Xcgr3q6BP5MpWT3hTn6d" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/files/Xcgr3q6BP5MpWT3hTn6d" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/files/aQnEyHWQGyok3qCc92qt" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/files/aQnEyHWQGyok3qCc92qt" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)

<details>

<summary>Support HackTricks</summary>

* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.

</details>
{% endhint %}

Table taken from the [**docs**](https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-principals-transact-sql?view=sql-server-ver16).

| Column name                                | Data type         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **name**                                   | **sysname**       | Name of principal, unique within the database.                                                                                                                                                                                                                                                                                                                                                                                                         |
| **principal\_id**                          | **int**           | ID of principal, unique within the database.                                                                                                                                                                                                                                                                                                                                                                                                           |
| **type**                                   | **char(1)**       | <p>Principal type:<br><br>A = Application role<br><br>C = User mapped to a certificate<br><br>E = External user from Azure Active Directory<br><br>G = Windows group<br><br>K = User mapped to an asymmetric key<br><br>R = Database role<br><br>S = SQL user<br><br>U = Windows user<br><br>X = External group from Azure Active Directory group or applications</p>                                                                                  |
| **type\_desc**                             | **nvarchar(60)**  | <p>Description of principal type.<br><br>APPLICATION\_ROLE<br><br>CERTIFICATE\_MAPPED\_USER<br><br>EXTERNAL\_USER<br><br>WINDOWS\_GROUP<br><br>ASYMMETRIC\_KEY\_MAPPED\_USER<br><br>DATABASE\_ROLE<br><br>SQL\_USER<br><br>WINDOWS\_USER<br><br>EXTERNAL\_GROUPS</p>                                                                                                                                                                                   |
| **default\_schema\_name**                  | **sysname**       | Name to be used when SQL name does not specify a schema. Null for principals not of type S, U, or A.                                                                                                                                                                                                                                                                                                                                                   |
| **create\_date**                           | **datetime**      | Time at which the principal was created.                                                                                                                                                                                                                                                                                                                                                                                                               |
| **modify\_date**                           | **datetime**      | Time at which the principal was last modified.                                                                                                                                                                                                                                                                                                                                                                                                         |
| **owning\_principal\_id**                  | **int**           | ID of the principal that owns this principal. All fixed Database Roles are owned by **dbo** by default.                                                                                                                                                                                                                                                                                                                                                |
| **sid**                                    | **varbinary(85)** | SID (Security Identifier) of the principal. NULL for SYS and INFORMATION SCHEMAS.                                                                                                                                                                                                                                                                                                                                                                      |
| **is\_fixed\_role**                        | **bit**           | If 1, this row represents an entry for one of the fixed database roles: db\_owner, db\_accessadmin, db\_datareader, db\_datawriter, db\_ddladmin, db\_securityadmin, db\_backupoperator, db\_denydatareader, db\_denydatawriter.                                                                                                                                                                                                                       |
| **authentication\_type**                   | **int**           | <p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.<br><br>Signifies authentication type. The following are the possible values and their descriptions.<br><br>0 : No authentication<br>1 : Instance authentication<br>2 : Database authentication<br>3 : Windows authentication<br>4 : Azure Active Directory authentication</p>                                                                                                        |
| **authentication\_type\_desc**             | **nvarchar(60)**  | <p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.<br><br>Description of the authentication type. The following are the possible values and their descriptions.<br><br><code>NONE</code> : No authentication<br><code>INSTANCE</code> : Instance authentication<br><code>DATABASE</code> : Database authentication<br><code>WINDOWS</code> : Windows authentication<br><code>EXTERNAL</code>: Azure Active Directory authentication</p> |
| **default\_language\_name**                | **sysname**       | <p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.<br><br>Signifies the default language for this principal.</p>                                                                                                                                                                                                                                                                                                                        |
| **default\_language\_lcid**                | **int**           | <p><strong>Applies to</strong>: SQL Server 2012 (11.x) and later.<br><br>Signifies the default LCID for this principal.</p>                                                                                                                                                                                                                                                                                                                            |
| **allow\_encrypted\_value\_modifications** | **bit**           | <p><strong>Applies to</strong>: SQL Server 2016 (13.x) and later, SQL Database.<br><br>Suppresses cryptographic metadata checks on the server in bulk copy operations. This enables the user to bulk copy data encrypted using Always Encrypted, between tables or databases, without decrypting the data. The default is OFF.</p>                                                                                                                     |

{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/files/Xcgr3q6BP5MpWT3hTn6d" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/files/Xcgr3q6BP5MpWT3hTn6d" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/files/aQnEyHWQGyok3qCc92qt" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/files/aQnEyHWQGyok3qCc92qt" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)

<details>

<summary>Support HackTricks</summary>

* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.

</details>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://angelica.gitbook.io/hacktricks/network-services-pentesting/pentesting-mssql-microsoft-sql-server/types-of-mssql-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
