Edit

Share via


SqlFunctions Class

Definition

Provides common language runtime (CLR) methods that call functions in the database in LINQ to Entities queries.

public ref class SqlFunctions abstract sealed
public static class SqlFunctions
type SqlFunctions = class
Public Class SqlFunctions
Inheritance
SqlFunctions

Methods

Acos(Nullable<Decimal>)

A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.

Acos(Nullable<Double>)

A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.

Ascii(String)

Returns the ASCII code value of the left-most character of a character expression.

Asin(Nullable<Decimal>)

A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.

Asin(Nullable<Double>)

A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.

Atan(Nullable<Decimal>)

A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.

Atan(Nullable<Double>)

A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.

Atan2(Nullable<Decimal>, Nullable<Decimal>)

Returns the positive angle, in radians, between the positive x-axis and the ray from the origin through the point (x, y), where x and y are the two specified numerical values. The first parameter passed to the function is the y-value and the second parameter is the x-value.

Atan2(Nullable<Double>, Nullable<Double>)

Returns the positive angle, in radians, between the positive x-axis and the ray from the origin through the point (x, y), where x and y are the two specified numerical values. The first parameter passed to the function is the y-value and the second parameter is the x-value.

Char(Nullable<Int32>)

Returns the character that corresponds to the specified integer ASCII value.

CharIndex(Byte[], Byte[], Nullable<Int32>)

Returns the starting position of one expression found within another expression.

CharIndex(Byte[], Byte[], Nullable<Int64>)

Returns the starting position of one expression found within another expression.

CharIndex(Byte[], Byte[])

Returns the starting position of one expression found within another expression.

CharIndex(String, String, Nullable<Int32>)

Returns the starting position of one expression found within another expression.

CharIndex(String, String, Nullable<Int64>)

Returns the starting position of one expression found within another expression.

CharIndex(String, String)

Returns the starting position of one expression found within another expression.

Checksum(Byte[], Byte[], Byte[])

Returns the checksum value computed over the input arguments.

Checksum(Byte[], Byte[])

Returns the checksum value computed over the input arguments.

Checksum(Byte[])

Returns the checksum value computed over the input argument.

Checksum(Nullable<Boolean>, Nullable<Boolean>, Nullable<Boolean>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Boolean>, Nullable<Boolean>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Boolean>)

Returns the checksum value computed over the input argument.

Checksum(Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<DateTime>, Nullable<DateTime>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<DateTime>)

Returns the checksum value computed over the input argument.

Checksum(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<DateTimeOffset>)

Returns the checksum value computed over the input argument.

Checksum(Nullable<Decimal>, Nullable<Decimal>, Nullable<Decimal>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Decimal>, Nullable<Decimal>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Decimal>)

Returns the checksum value computed over the input argument.

Checksum(Nullable<Double>, Nullable<Double>, Nullable<Double>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Double>, Nullable<Double>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Double>)

Returns the checksum value computed over the input argument.

Checksum(Nullable<Guid>, Nullable<Guid>, Nullable<Guid>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Guid>, Nullable<Guid>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<Guid>)

Returns the checksum value computed over the input argument.

Checksum(Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<TimeSpan>, Nullable<TimeSpan>)

Returns the checksum value computed over the input arguments.

Checksum(Nullable<TimeSpan>)

Returns the checksum value computed over the input argument.

Checksum(String, String, String)

Returns the checksum value computed over the input arguments.

Checksum(String, String)

Returns the checksum value computed over the input arguments.

Checksum(String)

Returns the checksum value computed over the input argument.

ChecksumAggregate(IEnumerable<Int32>)

Returns the checksum of the values in a collection. Null values are ignored.

ChecksumAggregate(IEnumerable<Nullable<Int32>>)

Returns the checksum of the values in a collection. Null values are ignored.

Cos(Nullable<Decimal>)

Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.

Cos(Nullable<Double>)

Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.

Cot(Nullable<Decimal>)

A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.

Cot(Nullable<Double>)

A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.

CurrentTimestamp()

Returns the current date and time.

CurrentUser()

Returns the name of the current user.

DataLength(Byte[])

Returns the number of bytes used to represent any expression.

DataLength(Nullable<Boolean>)

Returns the number of bytes used to represent any expression.

DataLength(Nullable<DateTime>)

Returns the number of bytes used to represent any expression.

DataLength(Nullable<DateTimeOffset>)

Returns the number of bytes used to represent any expression.

DataLength(Nullable<Decimal>)

Returns the number of bytes used to represent any expression.

DataLength(Nullable<Double>)

Returns the number of bytes used to represent any expression.

DataLength(Nullable<Guid>)

Returns the number of bytes used to represent any expression.

DataLength(Nullable<TimeSpan>)

Returns the number of bytes used to represent any expression.

DataLength(String)

Returns the number of bytes used to represent any expression.

DateAdd(String, Nullable<Double>, Nullable<DateTime>)

Returns a new datetime value based on adding an interval to the specified date.

DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>)

Returns a new date value based on adding an interval to the specified date.

DateAdd(String, Nullable<Double>, Nullable<TimeSpan>)

Returns a new time span value based on adding an interval to the specified time span.

DateAdd(String, Nullable<Double>, String)

Returns a new datetime value based on adding an interval to the specified date.

DateDiff(String, Nullable<DateTime>, Nullable<DateTime>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTime>, Nullable<DateTimeOffset>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTime>, Nullable<TimeSpan>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTime>, String)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTime>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTimeOffset>, Nullable<TimeSpan>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<DateTimeOffset>, String)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<TimeSpan>, Nullable<DateTime>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<TimeSpan>, Nullable<DateTimeOffset>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<TimeSpan>, Nullable<TimeSpan>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, Nullable<TimeSpan>, String)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, String, Nullable<DateTime>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, String, Nullable<DateTimeOffset>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, String, Nullable<TimeSpan>)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateDiff(String, String, String)

Returns the count of the specified datepart boundaries crossed between the specified start date and end date.

DateName(String, Nullable<DateTime>)

Returns a character string that represents the specified datepart of the specified date.

DateName(String, Nullable<DateTimeOffset>)

Returns a character string that represents the specified datepart of the specified date.

DateName(String, Nullable<TimeSpan>)

Returns a character string that represents the specified datepart of the specified date.

DateName(String, String)

Returns a character string that represents the specified datepart of the specified date.

DatePart(String, Nullable<DateTime>)

Returns an integer that represents the specified datepart of the specified date.

DatePart(String, Nullable<DateTimeOffset>)

Returns an integer that represents the specified datepart of the specified date.

DatePart(String, Nullable<TimeSpan>)

Returns an integer that represents the specified datepart of the specified date.

DatePart(String, String)

Returns an integer that represents the specified datepart of the specified date.

Degrees(Nullable<Decimal>)

Returns the corresponding angle in degrees for an angle specified in radians.

Degrees(Nullable<Double>)

Returns the corresponding angle in degrees for an angle specified in radians.

Degrees(Nullable<Int32>)

Returns the corresponding angle in degrees for an angle specified in radians.

Degrees(Nullable<Int64>)

Returns the corresponding angle in degrees for an angle specified in radians.

Difference(String, String)

Returns an integer value that indicates the difference between the SOUNDEX values of two character expressions.

Exp(Nullable<Decimal>)

Returns the exponential value of the specified float expression.

Exp(Nullable<Double>)

Returns the exponential value of the specified float expression.

GetDate()

Returns the current database system timestamp as a datetime value without the database time zone offset. This value is derived from the operating system of the computer on which the instance of SQL Server is running.

GetUtcDate()

Returns the current database system timestamp as a datetime value. The database time zone offset is not included. This value represents the current UTC time (Coordinated Universal Time). This value is derived from the operating system of the computer on which the instance of SQL Server is running.

HostName()

Returns the workstation name.

IsDate(String)

Indicates whether the input value is a valid date or time.

IsNumeric(String)

Indicates whether the input value is a valid numeric type.

Log(Nullable<Decimal>)

Returns the natural logarithm of the specified input value.

Log(Nullable<Double>)

Returns the natural logarithm of the specified input value.

Log10(Nullable<Decimal>)

Returns the base-10 logarithm of the specified input value.

Log10(Nullable<Double>)

Returns the base-10 logarithm of the specified input value.

NChar(Nullable<Int32>)

Returns the Unicode character with the specified integer code, as defined by the Unicode standard.

PatIndex(String, String)

Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.

Pi()

Returns the constant value of pi.

QuoteName(String, String)

Returns a Unicode string with the delimiters added to make the input string a valid Microsoft SQL Server delimited identifier.

QuoteName(String)

Returns a Unicode string with the delimiters added to make the input string a valid Microsoft SQL Server delimited identifier.

Radians(Nullable<Decimal>)

Returns the radian measure corresponding to the specified angle in degrees.

Radians(Nullable<Double>)

Returns the radian measure corresponding to the specified angle in degrees.

Radians(Nullable<Int32>)

Returns the radian measure corresponding to the specified angle in degrees.

Radians(Nullable<Int64>)

Returns the radian measure corresponding to the specified angle in degrees.

Rand()

Returns a pseudo-random float value from 0 through 1, exclusive.

Rand(Nullable<Int32>)

Returns a pseudo-random float value from 0 through 1, exclusive.

Replicate(String, Nullable<Int32>)

Repeats a string value a specified number of times.

Sign(Nullable<Decimal>)

Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.

Sign(Nullable<Double>)

Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.

Sign(Nullable<Int32>)

Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.

Sign(Nullable<Int64>)

Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.

Sin(Nullable<Decimal>)

Returns the trigonometric sine of the specified angle.

Sin(Nullable<Double>)

Returns the trigonometric sine of the specified angle.

SoundCode(String)

Converts an alphanumeric string to a four-character (SOUNDEX) code to find similar-sounding words or names.

Space(Nullable<Int32>)

Returns a string of repeated spaces.

Square(Nullable<Decimal>)

Returns the square of the specified number.

Square(Nullable<Double>)

Returns the square of the specified number.

SquareRoot(Nullable<Decimal>)

Returns the square root of the specified number.

SquareRoot(Nullable<Double>)

Returns the square root of the specified number.

StringConvert(Nullable<Decimal>, Nullable<Int32>, Nullable<Int32>)

Returns character data converted from numeric data.

StringConvert(Nullable<Decimal>, Nullable<Int32>)

Returns character data converted from numeric data.

StringConvert(Nullable<Decimal>)

Returns character data converted from numeric data.

StringConvert(Nullable<Double>, Nullable<Int32>, Nullable<Int32>)

Returns character data converted from numeric data.

StringConvert(Nullable<Double>, Nullable<Int32>)

Returns character data converted from numeric data.

StringConvert(Nullable<Double>)

Returns character data converted from numeric data.

Stuff(String, Nullable<Int32>, Nullable<Int32>, String)

Inserts a string into another string. It deletes a specified length of characters in the target string at the start position and then inserts the second string into the target string at the start position.

Tan(Nullable<Decimal>)

Returns the trigonometric tangent of the input expression.

Tan(Nullable<Double>)

Returns the trigonometric tangent of the input expression.

Unicode(String)

Returns the integer value, as defined by the Unicode standard, for the first character of the input expression.

UserName()

Returns a database user name corresponding to a specified identification number.

UserName(Nullable<Int32>)

Returns a database user name corresponding to a specified identification number.

Applies to