SQL Server ODBC Scalar Functions


The following lists the SQL Server ODBC scalar functions and their ANSI equivalents.

SQLANSIDescription
%Modmodulo of x base y
&bitwise and
^bitwise exclusive or
|bitwise (inclusive) or
~bitwise one's complement
+Concatconcatenate two strings
AbsAbsabsolute value
AcosAcosarc cosine
AsciiAsciiconverts a single char to an ASCII numeric value
AsinAsinarc sine
AtanAtanarc tangent of angle
Atn2Atan2arc tangent of two values
CastCastgeneral type conversion
CeilingCeilingleast integer greater than or equal
CharCharconverts an ASCII numeric value to a single char
CharIndexLocatesearches for a substring
Coalescereturns first non-null value
ConvertConvertgeneral type conversion
CosCoscosine of angle
CotCotcotangent of angle
DayDayOfMonthnumeric day of month
DB_NameDatabasedatabase name
DegreesDegreesconverts an angle in radians to degrees
DifferenceDifferencefuzzy string comparison
ExpExpnatural exponentiation
FloorFloorgreatest integer less than or equal
GetDateCurrent_Timestampcurrent date and time
GetUTCDatecurrent date and time in UTC
IsNullIfNullreturns first non-null value
LeftLeftsubstring from left side of a string
LengthChar_Lengthlength in characters of string
LogLognatural logarithm
Log10Log10base 10 logarithm
LowerLCaselowercase string
LTrimLTrimtrims whitespace from left side of string
MonthMonthnumeric month value
NCharconverts a Unicode numeric value to a single char
PiPivalue of pi
PowerPowerexponentiation
RadiansRadiansconverts an angle in degrees into radians
ReplicateRepeatgenerates n repeated characters
RoundRoundround to an integer value
RTrimRTrimtrims whitespace from right side of string
SignSignarithmetic sign of value
SinSinsine
SoundExSoundExgenerates hash of text string
SpaceSpacegenerate n spaces
SqrtSqrtsquare root
Squaresquare of the value
Stuffinserts a substring into a string
SubStringSubStringmiddle part of string extraction
TanTantangent of angle
Unicodeconverts a single char to an Unicode numeric value
UpperUCaseuppercase string
User_NameUseruser name
YearYearnumeric year value