SQRT Function in SQL Server 2008
In this article i will explain how to use SQRT Function in SQL.
SQRT() is mathematical function. It is used to return the square root of the given expression. It takes one argument whose squareroot value is to be find. Basic syntax of SQRT function is described below.
where float_expression is a float type expression. Return type of SQRT() function is float.
1. SQRT function in select clause.
It will return the squareroot of 5 i.e. 2.2360.
2. Return the square root of numbers from 1 to 5
declare @number float;
SET @number = 1.00;
WHILE @number <= 5.00
SET @number = @number + 1
Select all code and press F5 to run above code.