ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
2 out of 2 rated this helpful - Rate this topic

SQRT

SQL Server 2000

Returns the square root of the given expression.

Syntax

SQRT ( float_expression )

Arguments

float_expression

Is an expression of type float.

Return Types

float

Examples

This 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)
      SELECT @myvalue = @myvalue + 1
   END
GO

Here is the result set:

------------------------ 
1.0                      
------------------------ 
1.4142135623731          
------------------------ 
1.73205080756888         
------------------------ 
2.0                      
------------------------ 
2.23606797749979         
------------------------ 
2.44948974278318         
------------------------ 
2.64575131106459         
------------------------ 
2.82842712474619         
------------------------ 
3.0

See Also

Mathematical Functions

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.