Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.73 KB

File metadata and controls

65 lines (45 loc) · 1.73 KB
title SQUARE (SSIS Expression)
description SQUARE (SSIS Expression)
author chugugrace
ms.author chugu
ms.date 03/01/2017
ms.service sql
ms.subservice integration-services
ms.topic reference
helpviewer_keywords
SQUARE
square values

SQUARE (SSIS Expression)

[!INCLUDEsqlserver-ssis]

Returns the square of a numeric expression.

Syntax

  
SQUARE(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

SQUARE returns a null result if the argument is null.

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

Expression Examples

This example returns the square of 12. The return result is 144.

SQUARE(12)  

This example returns the square of the result of subtracting values in two columns. If Value1 contains 12 and Value2 contains 4, the SQUARE function returns 64.

SQUARE(Value1 - Value2)  

This example returns the length of the third side of a right angle 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)