SQL Server provides many built -in and user-defined functions. Some of the functions are discussed below:
Square() : The Square function is given to return the square of the given expression and returns the float value in SQL Server 2014.
Syntax : SQUARE (float_expression)
Example
SQRT (float_number) : The Sqrt functions are used to returns a square root of a floating-point number. The SQL SQRT function accepts only positive arguments and returns an error when a negative argument is passed in SQL Server 2014.
Syntax : SQRT(<numeric_expression>)
Example
ATN()2 : An ATN2 () function is a mathematical function that returns the angle in radians between the positive x-axis and the ray from the origin to the point (y, x), x and y are the values of the two specified float expressions in SQL. It returns a double-precision number between -1 and 1.
Syntax : ATN2 (float_expression , float_expression)
It takes two arguments, both are the float_expression, an expression of the type float or of a type that can be implicitly converted to float. It has a return type float only.
Example
EOMONTH() : The EOMONTH () is used to get the last day of the month that contains the specified date with an optional offset. This function can be remote to the SQL Server 2014 servers and higher, but cannot be remote to the servers with a version lower than SQL Server 2014.
Syntax : EOMONTH ( start_date [ month_to_add ] )
It takes two arguments.
First is the Start_date, the date expression specifying the date for which to return the last day of the month.
Second, the month_to_add, an Optional integer expression specifying the number of months to add to the start_date. It has the return type, date only.
Example 1
