Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 1.78 KB

sqrt-ssis-expression.md

File metadata and controls

67 lines (46 loc) · 1.78 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
SQRT (SSIS Expression)
SQRT (SSIS Expression)
chugugrace
chugu
03/01/2017
sql
integration-services
conceptual
SQRT function
square root of given expression

SQRT (SSIS Expression)

[!INCLUDEsqlserver-ssis]

Returns the square root of a numeric expression.

Syntax

  
SQRT(numeric_expression)  

Arguments

numeric_expression
Is a numeric expression of any numeric data type. For more information, see Integration Services Data Types.

Result Types

DT_R8

Remarks

SQRT returns a null result if the argument is null.

SQRT fails if the argument is a negative value.

The argument is cast to the DT_R8 data type before the square root operation.

Expression Examples

This example returns the square root of a numeric literal. The return result is 12.

SQRT(144)  

This example returns the square root of an expression, the result of subtracting values in the Value1 and Value2 columns.

SQRT(Value1 - Value2)  

This example returns the length of the third side of a right triangle by applying the SQUARE function to two variables and then calculating the square root of their sum. If Side1 contains 3 and Side2 contains 4, the SQRT function returns 5.

SQRT(SQUARE(@Side1) + SQUARE(@Side2))  

Note

In expressions, variable names always include the @ prefix.

See Also

Functions (SSIS Expression)