Table of Contents

Class SecuritySchema.SecurityPolicy

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

sys.security_policies (Transact-SQL)

Applies to: √ SQL Server 2016 (13.x) and later √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics

Returns a row for each security policy in the database.


See sys.security_policies.

[Table(Schema = "sys", Name = "security_policies", IsView = true)]
public class SecuritySchema.SecurityPolicy
Inheritance
SecuritySchema.SecurityPolicy
Extension Methods

Properties

CreateDate

UTC date the security policy was created.

[Column("create_date")]
[NotNull]
public DateTime CreateDate { get; set; }

Property Value

DateTime

IsEnabled

Security policy specification state:

0 = disabled

1 = enabled

[Column("is_enabled")]
[NotNull]
public bool IsEnabled { get; set; }

Property Value

bool

IsMSShipped

Always false.

[Column("is_ms_shipped")]
[NotNull]
public bool IsMSShipped { get; set; }

Property Value

bool

IsNotForReplication

Policy was created with the NOT FOR REPLICATION option.

[Column("is_not_for_replication")]
[NotNull]
public bool IsNotForReplication { get; set; }

Property Value

bool

IsSchemabindingEnabled

Schemabinding state for the security policy:

0 or NULL = enabled

1 = disabled

[Column("is_schemabinding_enabled")]
[NotNull]
public bool IsSchemabindingEnabled { get; set; }

Property Value

bool

ModifyDate

UTC date the security policy was last modified.

[Column("modify_date")]
[NotNull]
public DateTime ModifyDate { get; set; }

Property Value

DateTime

Name

Name of the security policy, unique within the database.

[Column("name")]
[NotNull]
public string Name { get; set; }

Property Value

string

Object

objects (sys.objects)

[Association(ThisKey = "ObjectID", OtherKey = "ObjectID", CanBeNull = false)]
public ObjectSchema.Object Object { get; set; }

Property Value

ObjectSchema.Object

ObjectID

ID of the security policy.

[Column("object_id")]
[NotNull]
public int ObjectID { get; set; }

Property Value

int

ParentObjectID

ID of the object to which the policy belongs. Must be 0.

[Column("parent_object_id")]
[NotNull]
public int ParentObjectID { get; set; }

Property Value

int

PrincipalID

ID of the owner of the security policy, as registered to the database. NULL if the owner is determined via the schema.

[Column("principal_id")]
[Nullable]
public int? PrincipalID { get; set; }

Property Value

int?

SchemaID

ID of the schema where the object resides.

[Column("schema_id")]
[NotNull]
public int SchemaID { get; set; }

Property Value

int

TypeColumn

Must be SP.

[Column("type")]
[Nullable]
public object? TypeColumn { get; set; }

Property Value

object

TypeDesc

SECURITY_POLICY.

[Column("type_desc")]
[Nullable]
public string? TypeDesc { get; set; }

Property Value

string

UsesDatabaseCollation

Uses the same collation as the database.

[Column("uses_database_collation")]
[Nullable]
public bool? UsesDatabaseCollation { get; set; }

Property Value

bool?