SQL Server Mathematical Functions (Full List)

Transact-SQL contains a number of mathematical functions that you can use with SQL Server.

The following scalar functions can be used in SQL Server 2012 and above. Most of these functions accept one or more arguments, and will return a numeric value based on the argument/s supplied.

ABS()
Returns the absolute (positive) value of the specified numeric expression. In other words, it allows you to determine whether a number is positive, negative, or zero.
ACOS()
Returns the arccosine. In other words, it returns the angle, in radians, whose cosine is the specified float expression.
ASIN()
Returns the arcsine. In other words, it returns the angle, in radians, whose sine is the specified float expression.
ATAN()
Returns the arctangent. In other words, it returns the angle, in radians, whose tangent is a specified float expression.
ATN2()
Returns the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x), where x and y are the values of the two specified float expressions.
CEILING()
Allows you to round a number up to the nearest integer. It returns the smallest integer greater than, or equal to, the specified numeric expression.
COS()
Returns the trigonometric cosine of the specified angle – measured in radians – in the specified expression.
COT()
Returns the trigonometric cotangent of the specified angle – in radians – in the specified float expression.
DEGREES()
Let’s you convert from radians to degrees. Specifically, this function returns the corresponding angle, in degrees, for an angle specified in radians.
EXP()
Returns the exponential value of the specified float expression.
FLOOR()
Lets you round down to the nearest integer. It returns the largest integer less than or equal to the specified numeric expression.
LOG()
Returns the natural logarithm of the specified float expression.
LOG10()
Returns the base-10 logarithm of the specified float expression.
PI()
Returns the constant value of PI.
POWER()
Returns the value of the specified expression to the specified power.
RADIANS()
Lets you convert from degrees to radians. Specifically, it returns radians when a numeric expression, in degrees, is entered.
RAND()
Returns a pseudo-random float value from 0 through 1, exclusive.
ROUND()
Returns a numeric value, rounded to the specified length or precision.
SIGN()
Returns the positive (+1), zero (0), or negative (-1) sign of the specified expression.
SIN()
Returns the trigonometric sine of the specified angle, in radians, and in an approximate numeric, float, expression.
SQRT()
Returns the square root of the specified float value.
SQUARE()
Returns the square of the specified float value.
TAN()
Returns the tangent of the input expression.

All functions except for RAND() are deterministic. This means they return the same results each time they are called with a specific set of input values. RAND() is deterministic only when a seed parameter is specified.