Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
SQRT (Transact-SQL)
Applies to: 👁 Image
SQL Server 👁 Image
Azure SQL Database 👁 Image
Azure SQL Managed Instance 👁 Image
Azure Synapse Analytics 👁 Image
Analytics Platform System (PDW) 👁 Image
SQL analytics endpoint in Microsoft Fabric 👁 Image
Warehouse in Microsoft Fabric 👁 Image
SQL database in Microsoft Fabric
Returns the square root of the specified float value.
👁 Image
Transact-SQL syntax conventions
Syntax
SQRT ( float_expression )
Arguments
float_expression
Is an expression of type float or of a type that can be implicitly converted to float.
Return Types
float
Examples
The following example returns the square root of numbers between 1.00 and 10.00.
DECLARE @myvalue FLOAT;
SET @myvalue = 1.00;
WHILE @myvalue < 10.00
BEGIN
SELECT SQRT(@myvalue);
SET @myvalue = @myvalue + 1
END;
GO
Here's the result set.
------------------------
1.0
------------------------
1.4142135623731
------------------------
1.73205080756888
------------------------
2.0
------------------------
2.23606797749979
------------------------
2.44948974278318
------------------------
2.64575131106459
------------------------
2.82842712474619
------------------------
3.0
Examples: Azure Synapse Analytics and Analytics Platform System (PDW)
The following example returns the square root of numbers 1.00 and 10.00.
SELECT SQRT(1.00), SQRT(10.00);
Here's the result set.
---------- ------------
1.00 3.16
See Also
Feedback
Was this page helpful?
