Table of Contents

Class Sql.Types

Namespace
LinqToDB
Assembly
linq2db.dll
public static class Sql.Types
Inheritance
Sql.Types

Properties

BigInt

[Sql.Property("Oracle", "Number(19)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("BigInt", ServerSideOnly = true, CanBeNull = false)]
public static long BigInt { get; }

Property Value

long

Bit

[Sql.Property("Informix", "Boolean", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("PostgreSQL", "Boolean", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "Boolean", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SQLite", "Boolean", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "TinyInt", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Bit", ServerSideOnly = true, CanBeNull = false)]
public static bool Bit { get; }

Property Value

bool

Date

[Sql.Property("SqlServer.2005", "Datetime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlCe", "Datetime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Date", ServerSideOnly = true, CanBeNull = false)]
public static DateTime Date { get; }

Property Value

DateTime

DateTime

[Sql.Property("PostgreSQL", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("DateTime", ServerSideOnly = true, CanBeNull = false)]
public static DateTime DateTime { get; }

Property Value

DateTime

DateTime2

[Sql.Property("SqlServer.2005", "DateTime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("PostgreSQL", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "DateTime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlCe", "DateTime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Sybase", "DateTime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("DateTime2", ServerSideOnly = true, CanBeNull = false)]
public static DateTime DateTime2 { get; }

Property Value

DateTime

DateTimeOffset

[Sql.Property("PostgreSQL", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2022", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2019", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2017", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2016", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2014", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2012", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlServer.2008", "DateTimeOffset", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("DateTime", ServerSideOnly = true, CanBeNull = false)]
public static DateTimeOffset DateTimeOffset { get; }

Property Value

DateTimeOffset

DefaultChar

[Sql.Property("SqlCe", "NChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Char", ServerSideOnly = true, CanBeNull = false)]
public static string DefaultChar { get; }

Property Value

string

DefaultDecimal

[Sql.Property("Decimal", ServerSideOnly = true, CanBeNull = false)]
public static decimal DefaultDecimal { get; }

Property Value

decimal

DefaultNChar

[Sql.Property("DB2", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("NChar", ServerSideOnly = true, CanBeNull = false)]
public static string DefaultNChar { get; }

Property Value

string

DefaultNVarChar

[Sql.Property("DB2", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Oracle", "VarChar2", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "VarChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("PostgreSQL", "VarChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("NVarChar", ServerSideOnly = true, CanBeNull = false)]
public static string DefaultNVarChar { get; }

Property Value

string

DefaultVarChar

[Sql.Property("MySql", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlCe", "NVarChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("VarChar", ServerSideOnly = true, CanBeNull = false)]
public static string DefaultVarChar { get; }

Property Value

string

Float

[Sql.Property("MySql", "Decimal(29,10)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "Double", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Float", ServerSideOnly = true, CanBeNull = false)]
public static double Float { get; }

Property Value

double

Int

[Sql.Property("MySql", "Signed", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Int", ServerSideOnly = true, CanBeNull = false)]
public static int Int { get; }

Property Value

int

Money

[Sql.Property("Oracle", "Number(19,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "Decimal(18,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("PostgreSQL", "Decimal(19,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "Decimal(19,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "Decimal(19,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Money", ServerSideOnly = true, CanBeNull = false)]
public static decimal Money { get; }

Property Value

decimal

Real

[Sql.Property("MySql", "Decimal(29,10)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Real", ServerSideOnly = true, CanBeNull = false)]
public static float Real { get; }

Property Value

float

SmallDateTime

[Sql.Property("PostgreSQL", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "TimeStamp", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "DateTime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlCe", "DateTime", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "SecondDate", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SmallDateTime", ServerSideOnly = true, CanBeNull = false)]
public static DateTime SmallDateTime { get; }

Property Value

DateTime

SmallInt

[Sql.Property("MySql", "Signed", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SmallInt", ServerSideOnly = true, CanBeNull = false)]
public static short SmallInt { get; }

Property Value

short

SmallMoney

[Sql.Property("Informix", "Decimal(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Oracle", "Number(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "Decimal(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("PostgreSQL", "Decimal(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "Decimal(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SqlCe", "Decimal(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SapHana", "Decimal(10,4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("SmallMoney", ServerSideOnly = true, CanBeNull = false)]
public static decimal SmallMoney { get; }

Property Value

decimal

Time

[Sql.Property("Time", ServerSideOnly = true, CanBeNull = false)]
public static DateTime Time { get; }

Property Value

DateTime

TinyInt

[Sql.Property("DB2", "SmallInt", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Informix", "SmallInt", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Oracle", "Number(3)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("DB2", "SmallInt", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("Firebird", "SmallInt", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("PostgreSQL", "SmallInt", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("MySql", "Unsigned", ServerSideOnly = true, CanBeNull = false)]
[Sql.Property("TinyInt", ServerSideOnly = true, CanBeNull = false)]
public static byte TinyInt { get; }

Property Value

byte

Methods

Char(int)

[Sql.Function("SqlCe", "NChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function(ServerSideOnly = true, CanBeNull = false)]
public static string Char(int length)

Parameters

length int

Returns

string

Decimal(int)

[Sql.Expression("SapHana", "Decimal({0},4)", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function(ServerSideOnly = true, CanBeNull = false)]
public static decimal Decimal(int precision)

Parameters

precision int

Returns

decimal

Decimal(int, int)

[Sql.Function(ServerSideOnly = true, CanBeNull = false)]
public static decimal Decimal(int precision, int scale)

Parameters

precision int
scale int

Returns

decimal

NChar(int)

[Sql.Function("DB2", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function(ServerSideOnly = true, CanBeNull = false)]
public static string NChar(int length)

Parameters

length int

Returns

string

NVarChar(int)

[Sql.Function("DB2", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function("Oracle", "VarChar2", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function("Firebird", "VarChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function("PostgreSQL", "VarChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function("MySql", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function(ServerSideOnly = true, CanBeNull = false)]
public static string NVarChar(int length)

Parameters

length int

Returns

string

VarChar(int)

[Sql.Function("MySql", "Char", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function("SqlCe", "NVarChar", ServerSideOnly = true, CanBeNull = false)]
[Sql.Function(ServerSideOnly = true, CanBeNull = false)]
public static string VarChar(int length)

Parameters

length int

Returns

string