SQRT (Transact-SQL)

Restituisce la radice quadrata del valore float specificato.

Icona di collegamento a un argomentoConvenzioni della sintassi Transact-SQL

Sintassi

SQRT ( float_expression )

Argomenti

  • float_expression
    Espressione di tipo float o di un tipo convertibile in modo implicito nel tipo float.

Tipi restituiti

float

Esempi

Nell'esempio seguente viene restituita la radice quadrata dei numeri compresi tra 1.00 e 10.00.

DECLARE @myvalue float;
SET @myvalue = 1.00;
WHILE @myvalue < 10.00
   BEGIN
      SELECT SQRT(@myvalue);
      SET @myvalue = @myvalue + 1
   END;
GO

Set di risultati:

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

Vedere anche

Riferimento