Export (0) Print
Expand All

SqlFunctions Class

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

System.Object
  System.Data.Objects.SqlClient.SqlFunctions

Namespace:  System.Data.Objects.SqlClient
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public static class SqlFunctions

The SqlFunctions type exposes the following members.

  NameDescription
Public methodStatic memberAcos(Nullable<Decimal>)A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.
Public methodStatic memberAcos(Nullable<Double>)A mathematical function that returns the angle, in radians, whose cosine is the specified numerical value. This angle is called the arccosine.
Public methodStatic memberAsciiReturns the ASCII code value of the left-most character of a character expression.
Public methodStatic memberAsin(Nullable<Decimal>)A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.
Public methodStatic memberAsin(Nullable<Double>)A mathematical function that returns the angle, in radians, whose sine is the specified numerical value. This angle is called the arcsine.
Public methodStatic memberAtan(Nullable<Decimal>)A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.
Public methodStatic memberAtan(Nullable<Double>)A mathematical function that returns the angle, in radians, whose tangent is the specified numerical value. This angle is called the arctangent.
Public methodStatic memberAtan2(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.
Public methodStatic memberAtan2(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.
Public methodStatic memberCharReturns the character that corresponds to the specified integer ASCII value.
Public methodStatic memberCharIndex(Byte[], Byte[])Returns the starting position of one expression found within another expression.
Public methodStatic memberCharIndex(String, String)Returns the starting position of one expression found within another expression.
Public methodStatic memberCharIndex(Byte[], Byte[], Nullable<Int32>)Returns the starting position of one expression found within another expression.
Public methodStatic memberCharIndex(Byte[], Byte[], Nullable<Int64>)Returns the starting position of one expression found within another expression.
Public methodStatic memberCharIndex(String, String, Nullable<Int32>)Returns the starting position of one expression found within another expression.
Public methodStatic memberCharIndex(String, String, Nullable<Int64>)Returns the starting position of one expression found within another expression.
Public methodStatic memberChecksum(Nullable<Boolean>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Byte[])Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<DateTime>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<DateTimeOffset>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<Decimal>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<Double>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<Guid>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<TimeSpan>)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(String)Returns the checksum value computed over the input argument.
Public methodStatic memberChecksum(Nullable<Boolean>, Nullable<Boolean>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Byte[], Byte[])Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<DateTime>, Nullable<DateTime>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Decimal>, Nullable<Decimal>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Double>, Nullable<Double>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Guid>, Nullable<Guid>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<TimeSpan>, Nullable<TimeSpan>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(String, String)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Boolean>, Nullable<Boolean>, Nullable<Boolean>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Byte[], Byte[], Byte[])Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Decimal>, Nullable<Decimal>, Nullable<Decimal>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Double>, Nullable<Double>, Nullable<Double>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<Guid>, Nullable<Guid>, Nullable<Guid>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(Nullable<TimeSpan>, Nullable<TimeSpan>, Nullable<TimeSpan>)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksum(String, String, String)Returns the checksum value computed over the input arguments.
Public methodStatic memberChecksumAggregate(IEnumerable<Int32>)Returns the checksum of the values in a collection. Null values are ignored.
Public methodStatic memberChecksumAggregate(IEnumerable<Nullable<Int32>>)Returns the checksum of the values in a collection. Null values are ignored.
Public methodStatic memberCos(Nullable<Decimal>)Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.
Public methodStatic memberCos(Nullable<Double>)Returns the trigonometric cosine of the specified angle, in radians, in the specified expression.
Public methodStatic memberCot(Nullable<Decimal>)A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.
Public methodStatic memberCot(Nullable<Double>)A mathematical function that returns the trigonometric cotangent of the specified angle, in radians.
Public methodStatic memberCurrentTimestampReturns the current date and time.
Public methodStatic memberCurrentUserReturns the name of the current user.
Public methodStatic memberDataLength(Nullable<Boolean>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Byte[])Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Nullable<DateTime>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Nullable<DateTimeOffset>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Nullable<Decimal>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Nullable<Double>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Nullable<Guid>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(Nullable<TimeSpan>)Returns the number of bytes used to represent any expression.
Public methodStatic memberDataLength(String)Returns the number of bytes used to represent any expression.
Public methodStatic memberDateAdd(String, Nullable<Double>, Nullable<DateTime>)Returns a new datetime value based on adding an interval to the specified date.
Public methodStatic memberDateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>)Returns a new date value based on adding an interval to the specified date.
Public methodStatic memberDateAdd(String, Nullable<Double>, Nullable<TimeSpan>)Returns a new time span value based on adding an interval to the specified time span.
Public methodStatic memberDateAdd(String, Nullable<Double>, String)Returns a new datetime value based on adding an interval to the specified date.
Public methodStatic memberDateDiff(String, Nullable<DateTime>, Nullable<DateTime>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTime>, Nullable<DateTimeOffset>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTime>, Nullable<TimeSpan>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTime>, String)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTime>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTimeOffset>, Nullable<TimeSpan>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<DateTimeOffset>, String)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<TimeSpan>, Nullable<DateTime>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<TimeSpan>, Nullable<DateTimeOffset>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<TimeSpan>, Nullable<TimeSpan>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, Nullable<TimeSpan>, String)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, String, Nullable<DateTime>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, String, Nullable<DateTimeOffset>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, String, Nullable<TimeSpan>)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateDiff(String, String, String)Returns the count of the specified datepart boundaries crossed between the specified start date and end date.
Public methodStatic memberDateName(String, Nullable<DateTime>)Returns a character string that represents the specified datepart of the specified date.
Public methodStatic memberDateName(String, Nullable<DateTimeOffset>)Returns a character string that represents the specified datepart of the specified date.
Public methodStatic memberDateName(String, Nullable<TimeSpan>)Returns a character string that represents the specified datepart of the specified date.
Public methodStatic memberDateName(String, String)Returns a character string that represents the specified datepart of the specified date.
Public methodStatic memberDatePart(String, Nullable<DateTime>)Returns an integer that represents the specified datepart of the specified date.
Public methodStatic memberDatePart(String, Nullable<DateTimeOffset>)Returns an integer that represents the specified datepart of the specified date.
Public methodStatic memberDatePart(String, Nullable<TimeSpan>)Returns an integer that represents the specified datepart of the specified date.
Public methodStatic memberDatePart(String, String)Returns an integer that represents the specified datepart of the specified date.
Public methodStatic memberDegrees(Nullable<Decimal>)Returns the corresponding angle in degrees for an angle specified in radians.
Public methodStatic memberDegrees(Nullable<Double>)Returns the corresponding angle in degrees for an angle specified in radians.
Public methodStatic memberDegrees(Nullable<Int32>)Returns the corresponding angle in degrees for an angle specified in radians.
Public methodStatic memberDegrees(Nullable<Int64>)Returns the corresponding angle in degrees for an angle specified in radians.
Public methodStatic memberDifferenceReturns an integer value that indicates the difference between the SOUNDEX values of two character expressions.
Public methodStatic memberExp(Nullable<Decimal>)Returns the exponential value of the specified float expression.
Public methodStatic memberExp(Nullable<Double>)Returns the exponential value of the specified float expression.
Public methodStatic memberGetDateReturns 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.
Public methodStatic memberGetUtcDateReturns 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.
Public methodStatic memberHostNameReturns the workstation name.
Public methodStatic memberIsDateIndicates whether the input value is a valid date or time.
Public methodStatic memberIsNumericIndicates whether the input value is a valid numeric type.
Public methodStatic memberLog(Nullable<Decimal>)Returns the natural logarithm of the specified input value.
Public methodStatic memberLog(Nullable<Double>)Returns the natural logarithm of the specified input value.
Public methodStatic memberLog10(Nullable<Decimal>)Returns the base-10 logarithm of the specified input value.
Public methodStatic memberLog10(Nullable<Double>)Returns the base-10 logarithm of the specified input value.
Public methodStatic memberNCharReturns the Unicode character with the specified integer code, as defined by the Unicode standard.
Public methodStatic memberPatIndexReturns 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.
Public methodStatic memberPiReturns the constant value of pi.
Public methodStatic memberQuoteName(String)Returns a Unicode string with the delimiters added to make the input string a valid Microsoft SQL Server delimited identifier.
Public methodStatic memberQuoteName(String, String)Returns a Unicode string with the delimiters added to make the input string a valid Microsoft SQL Server delimited identifier.
Public methodStatic memberRadians(Nullable<Decimal>)Returns the radian measure corresponding to the specified angle in degrees.
Public methodStatic memberRadians(Nullable<Double>)Returns the radian measure corresponding to the specified angle in degrees.
Public methodStatic memberRadians(Nullable<Int32>)Returns the radian measure corresponding to the specified angle in degrees.
Public methodStatic memberRadians(Nullable<Int64>)Returns the radian measure corresponding to the specified angle in degrees.
Public methodStatic memberRand()Returns a pseudo-random float value from 0 through 1, exclusive.
Public methodStatic memberRand(Nullable<Int32>)Returns a pseudo-random float value from 0 through 1, exclusive.
Public methodStatic memberReplicateRepeats a string value a specified number of times.
Public methodStatic memberSign(Nullable<Decimal>)Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.
Public methodStatic memberSign(Nullable<Double>)Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.
Public methodStatic memberSign(Nullable<Int32>)Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.
Public methodStatic memberSign(Nullable<Int64>)Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.
Public methodStatic memberSin(Nullable<Decimal>)Returns the trigonometric sine of the specified angle.
Public methodStatic memberSin(Nullable<Double>)Returns the trigonometric sine of the specified angle.
Public methodStatic memberSoundCodeConverts an alphanumeric string to a four-character (SOUNDEX) code to find similar-sounding words or names.
Public methodStatic memberSpaceReturns a string of repeated spaces.
Public methodStatic memberSquare(Nullable<Decimal>)Returns the square of the specified number.
Public methodStatic memberSquare(Nullable<Double>)Returns the square of the specified number.
Public methodStatic memberSquareRoot(Nullable<Decimal>)Returns the square root of the specified number.
Public methodStatic memberSquareRoot(Nullable<Double>)Returns the square root of the specified number.
Public methodStatic memberStringConvert(Nullable<Decimal>)Returns character data converted from numeric data.
Public methodStatic memberStringConvert(Nullable<Double>)Returns character data converted from numeric data.
Public methodStatic memberStringConvert(Nullable<Decimal>, Nullable<Int32>)Returns character data converted from numeric data.
Public methodStatic memberStringConvert(Nullable<Double>, Nullable<Int32>)Returns character data converted from numeric data.
Public methodStatic memberStringConvert(Nullable<Decimal>, Nullable<Int32>, Nullable<Int32>)Returns character data converted from numeric data.
Public methodStatic memberStringConvert(Nullable<Double>, Nullable<Int32>, Nullable<Int32>)Returns character data converted from numeric data.
Public methodStatic memberStuffInserts 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.
Public methodStatic memberTan(Nullable<Decimal>)Returns the trigonometric tangent of the input expression.
Public methodStatic memberTan(Nullable<Double>)Returns the trigonometric tangent of the input expression.
Public methodStatic memberUnicodeReturns the integer value, as defined by the Unicode standard, for the first character of the input expression.
Public methodStatic memberUserName()Returns a database user name corresponding to a specified identification number.
Public methodStatic memberUserName(Nullable<Int32>)Returns a database user name corresponding to a specified identification number.
Top

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft