Table of Contents

Class SecuritySchema.ServerPrincipal

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

sys.server_principals (Transact-SQL)

Applies to:SQL ServerAzure SQL DatabaseAzure SQL Managed InstanceAnalytics Platform System (PDW)

Contains a row for every server-level principal.

note


[Microsoft Entra ID](/entra/fundamentals/new-name) was previously known as Azure Active Directory (Azure AD).


.

See sys.server_principals.

[Table(Schema = "sys", Name = "server_principals", IsView = true)]
public class SecuritySchema.ServerPrincipal
Inheritance
SecuritySchema.ServerPrincipal
Inherited Members
Extension Methods

Properties

CreateDate

create_date NOT NULL datetime

Time at which the principal was created.
[Column("create_date")]
[NotNull]
public DateTime CreateDate { get; set; }

Property Value

DateTime

CredentialID

credential_id NULL int

ID of a credential associated with the principal. If no credential is associated with this principal, credential_id is NULL.
[Column("credential_id")]
[Nullable]
public int? CredentialID { get; set; }

Property Value

int?

DefaultDatabaseName

default_database_name NULL sysname

Default database for the principal.
[Column("default_database_name")]
[Nullable]
public string? DefaultDatabaseName { get; set; }

Property Value

string

DefaultLanguageName

default_language_name NULL sysname

Default language for the principal.
[Column("default_language_name")]
[Nullable]
public string? DefaultLanguageName { get; set; }

Property Value

string

IsDisabled

is_disabled NULL int

1 = Login is disabled.
0 = Login is enabled.
[Column("is_disabled")]
[Nullable]
public int? IsDisabled { get; set; }

Property Value

int?

IsFixedRole

is_fixed_role NOT NULL bit

Returns 1 if the principal is one of the built-in server roles with fixed permissions. For more information, see Server-Level Roles.
[Column("is_fixed_role")]
[NotNull]
public bool IsFixedRole { get; set; }

Property Value

bool

ModifyDate

modify_date NOT NULL datetime

Time at which the principal definition was last modified.
[Column("modify_date")]
[NotNull]
public DateTime ModifyDate { get; set; }

Property Value

DateTime

Name

name NOT NULL sysname

Name of the principal. Is unique within a server.
[Column("name")]
[NotNull]
public string Name { get; set; }

Property Value

string

OwningPrincipalID

owning_principal_id NULL int

The principal_id of the owner of a server role. NULL if the principal is not a server role.
[Column("owning_principal_id")]
[Nullable]
public int? OwningPrincipalID { get; set; }

Property Value

int?

PrincipalID

principal_id NOT NULL int

ID number of the Principal. Is unique within a server.
[Column("principal_id")]
[NotNull]
public int PrincipalID { get; set; }

Property Value

int

SID

sid NULL varbinary(85)

Security Identifier (SID) of the principal.
A Windows principal's SID matches their Windows SID.
A Microsoft Entra user identity's SID is the binary representation of its Microsoft Entra object ID.
A Microsoft Entra group's SID is the binary representation of its Microsoft Entra object ID.
A Microsoft Entra application's SID is the binary representation of its Microsoft Entra client ID.
[Column("sid")]
[Nullable]
public byte[]? SID { get; set; }

Property Value

byte[]

Type

type NOT NULL char(1)

Principal type:

S = SQL login
R = Server role

Available in SQL Server, Azure SQL Managed Instance, and PDW (In preview in Azure SQL Database):
E = External login or application from Microsoft Entra ID
X = External group from Microsoft Entra ID

Available in SQL Server, Azure SQL Managed Instance, and PDW (not Azure SQL Database):
U = Windows login
G = Windows group
C = Login mapped to a certificate
K = Login mapped to an asymmetric key
[Column("type")]
[NotNull]
public string Type { get; set; }

Property Value

string

TypeDesc

type_desc NULL nvarchar(60)

Description of the principal type:

SQL_LOGIN
SERVER_ROLE

Available in SQL Server, Azure SQL Managed Instance, and PDW (In preview in Azure SQL Database):
EXTERNAL_LOGIN
EXTERNAL_GROUP

Available in SQL Server, Azure SQL Managed Instance, and PDW (not Azure SQL Database):
WINDOWS_LOGIN
WINDOWS_GROUP
CERTIFICATE_MAPPED_LOGIN
ASYMMETRIC_KEY_MAPPED_LOGIN
[Column("type_desc")]
[Nullable]
public string? TypeDesc { get; set; }

Property Value

string