SQL Server SQRT() Function
Updated on
SQRT() returns the square root of a numeric expression as a float. The input must be a float or a type that SQL Server can implicitly convert to float. See Microsoft’s SQRT() reference.
Syntax
SQRT(float_expression)
float_expression is the value whose square root SQL Server calculates. The result type is float.
Examples
The input can be an integer or decimal value; SQL Server converts it to float and returns a floating-point result:
SELECT SQRT(9) AS exact_root,
SQRT(2) AS approximate_root;
| exact_root | approximate_root |
|---|---|
| 3.0 | 1.4142135623731 |
Use SQRT() when the formula requires a square root. For exponentiation, see POWER().