# Types of MSSQL Users

{% hint style="success" %}
Learn & practice AWS Hacking:<img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-ce8af1068db7be4ad9003f8ddb02fea8f943f1a4%2Farte.png?alt=media" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-ce8af1068db7be4ad9003f8ddb02fea8f943f1a4%2Farte.png?alt=media" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-54ee1fb931f39d1e6f50150361b6aa1927f4ee88%2Fgrte.png?alt=media" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-54ee1fb931f39d1e6f50150361b6aa1927f4ee88%2Fgrte.png?alt=media" 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="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-ce8af1068db7be4ad9003f8ddb02fea8f943f1a4%2Farte.png?alt=media" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-ce8af1068db7be4ad9003f8ddb02fea8f943f1a4%2Farte.png?alt=media" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-54ee1fb931f39d1e6f50150361b6aa1927f4ee88%2Fgrte.png?alt=media" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="https://4053168017-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbkAZDoSuRHGdNlWHdyKs%2Fuploads%2Fgit-blob-54ee1fb931f39d1e6f50150361b6aa1927f4ee88%2Fgrte.png?alt=media" 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 %}
