Math Functions – SQUARE()

I am going to dig in and write another short article or tidbit on Transaction SQL math functions. Most, if not all, of these functions have been in the product before the release of SQL Server 2005.

I am very proud of my daughter making the advance math class in sixth grade. I am dedicating these blogs to her hard class work and love of the subject.

I will be exploring the SQUARE() function today.

This function takes a number N as input in either exact numeric or approximate numeric form. This does not include the BIT data type. The output of the function is the result of multiplying N times itself.

The example below tests the function with three different inputs: exact negative number, approximate numbers and a NULL value as arguments. I also demonstrate that the POWER() function can be used in place of the SQUARE() function.

The output from the test is listed below.

In short, the SQUARE algebra function is the result of multiplying a number, or other expression, by itself. Next time I will be talking about square roots.

Related posts

Leave a Comment