Collections:
Mathematical Functions Supported by SQL Server 2005 in SQL Server
What Are the Mathematical Functions Supported by SQL Server 2005 in SQL Server Transact-SQL?
✍: FYIcenter.com
SQL Server 2005 supports 23 mathematical functions: ABS, ACOS, ASIN, ATAN, ATN2, CEILING, COS, COT, DEGREES, EXP, FLOOR, LOG, LOG10, PI, POWER, RADIANS, RAND, ROUND, SIGN, SIN, SQRT, SQUARE, and TAN.
The return data types of mathematical functions are determined by two rules:
The tutorial exercise gives you some good examples on how to use mathematical functions:
-- ABS returns the same data type as the input DECLARE @x FLOAT(53); DECLARE @y NUMERIC(9,2); DECLARE @z INT; SET @x = -12345.123456789E+20; SET @y = -12345.12; SET @z = -12345 SELECT ABS(@x); SELECT ABS(@y); SELECT ABS(@z); GO 1.2345123456789E+24 12345.12 12345 -- SQRT converts input to FLOAT(53) first DECLARE @x FLOAT(53); DECLARE @y NUMERIC(9,2); DECLARE @z INT; SET @x = 12345.123456789E+20; SET @y = 12345.12; SET @z = 12345 SELECT SQRT(@x); SELECT SQRT(@y); SELECT SQRT(@z); GO 1111086110829.8 111.108595527079 111.108055513541
⇒ FLOOR, CEILING, ROUND - Converting Values to Integers in SQL Server
⇐ Overflow Errors on Converting Big Values to NUMERIC in SQL Server
⇑ Numeric Expressions and Functions in SQL Server Transact-SQL
2017-03-22, 1676🔥, 0💬
Popular Posts:
How To Verify Your PHP Installation in MySQL? PHP provides two execution interfaces: Command Line In...
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parame...
Where to find answers to frequently asked questions on PHP Connections and Query Execution for MySQL...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parame...