Table of Contents

Class ScalarTypesSchema.Type

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

sys.types (Transact-SQL)

Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)

Contains a row for each system and user-defined type.


See sys.types.

[Table(Schema = "sys", Name = "types", IsView = true)]
public class ScalarTypesSchema.Type
Inheritance
ScalarTypesSchema.Type
Extension Methods

Properties

CollationName

Name of the collation of the type if it is character-based; other wise, NULL.

[Column("collation_name")]
[Nullable]
public string? CollationName { get; set; }

Property Value

string

DefaultObjectID

ID of the stand-alone default that is bound to the type by using sp_bindefault.

0 = No default exists.

[Column("default_object_id")]
[NotNull]
public int DefaultObjectID { get; set; }

Property Value

int

IsAssemblyType

1 = Implementation of the type is defined in a CLR assembly.

0 = Type is based on a SQL Server system data type.

[Column("is_assembly_type")]
[NotNull]
public bool IsAssemblyType { get; set; }

Property Value

bool

IsNullable

Type is nullable.

[Column("is_nullable")]
[Nullable]
public bool? IsNullable { get; set; }

Property Value

bool?

IsTableType

Indicates the type is a table.

[Column("is_table_type")]
[NotNull]
public bool IsTableType { get; set; }

Property Value

bool

IsUserDefined

1 = User-defined type.

0 = SQL Server system data type.

[Column("is_user_defined")]
[NotNull]
public bool IsUserDefined { get; set; }

Property Value

bool

MaxLength

Maximum length (in bytes) of the type.

-1 = Column data type is varchar(max), nvarchar(max), varbinary(max), or xml.

For text columns, the max_length value will be 16.

[Column("max_length")]
[NotNull]
public short MaxLength { get; set; }

Property Value

short

Name

Name of the type. Is unique within the schema.

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

Property Value

string

Precision

Max precision of the type if it is numeric-based; otherwise, 0.

[Column("precision")]
[NotNull]
public byte Precision { get; set; }

Property Value

byte

PrincipalID

ID of the individual owner if different from schema owner. By default, schema-contained objects are owned by the schema owner. However, an alternate owner can be specified by using the ALTER AUTHORIZATION statement to change ownership.

NULL if there is no alternate individual owner.

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

Property Value

int?

RuleObjectID

ID of the stand-alone rule that is bound to the type by using sp_bindrule.

0 = No rule exists.

[Column("rule_object_id")]
[NotNull]
public int RuleObjectID { get; set; }

Property Value

int

Scale

Max scale of the type if it is numeric-based; otherwise, 0.

[Column("scale")]
[NotNull]
public byte Scale { get; set; }

Property Value

byte

SchemaID

ID of the schema to which the type belongs.

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

Property Value

int

SystemTypeID

ID of the internal system-type of the type.

[Column("system_type_id")]
[NotNull]
public byte SystemTypeID { get; set; }

Property Value

byte

UserTypeID

ID of the type. Is unique within the database. For system data types, user_type_id = system_type_id.

[Column("user_type_id")]
[NotNull]
public int UserTypeID { get; set; }

Property Value

int