Export (0) Print
Expand All

SQUARE (Transact-SQL)

 

Applies To: SQL Server 2014, SQL Server 2016 Preview

Returns the square of the specified float value.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Data Warehouse Public Preview.

Topic link icon Transact-SQL Syntax Conventions


SQUARE ( float_expression )

float_expression

Is an expression of type float or of a type that can be implicitly converted to float.

The following example returns the volume of a cylinder having a radius of 1 inch and a height of 5 inches.

DECLARE @h float, @r float;
SET @h = 5;
SET @r = 1;
SELECT PI()* SQUARE(@r)* @h AS 'Cyl Vol';

Here is the result set.

Cyl Vol
--------------------------
15.707963267948966
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft