| description | ASIN (Transact-SQL) | |||
|---|---|---|---|---|
| title | ASIN (Transact-SQL) | Microsoft Docs | |||
| ms.custom | ||||
| ms.date | 07/24/2017 | |||
| ms.prod | sql | |||
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | |||
| ms.reviewer | ||||
| ms.technology | t-sql | |||
| ms.topic | reference | |||
| f1_keywords |
|
|||
| dev_langs |
|
|||
| helpviewer_keywords |
|
|||
| ms.assetid | 6256dd7d-83d5-486e-a933-1d59afc7e417 | |||
| author | cawrites | |||
| ms.author | chadam | |||
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE sql-asdb-asdbmi-asa-pdw]
A function that returns the angle, in radians, whose sine is the specified float expression. This is also called arcsine.
Transact-SQL Syntax Conventions
ASIN ( float_expression )
[!INCLUDEsql-server-tsql-previous-offline-documentation]
float_expression
An expression of either type float or of a type that can implicitly convert to float. Only a value ranging from -1.00 to 1.00 is valid. Values outside this range return NULL, and ASIN will report a domain error.
float
This example takes a float expression and returns the ASIN value of the specified angle.
/* The first value will be -1.01. This fails because the value is
outside the range.*/
DECLARE @angle FLOAT
SET @angle = -1.01
SELECT 'The ASIN of the angle is: ' + CONVERT(VARCHAR, ASIN(@angle))
GO
-- The next value is -1.00.
DECLARE @angle FLOAT
SET @angle = -1.00
SELECT 'The ASIN of the angle is: ' + CONVERT(VARCHAR, ASIN(@angle))
GO
-- The next value is 0.1472738.
DECLARE @angle FLOAT
SET @angle = 0.1472738
SELECT 'The ASIN of the angle is: ' + CONVERT(VARCHAR, ASIN(@angle))
GO [!INCLUDEssResult]
-------------------------
.Net SqlClient Data Provider: Msg 3622, Level 16, State 1, Line 3
A domain error occurred.
---------------------------------
The ASIN of the angle is: -1.5708
(1 row(s) affected)
----------------------------------
The ASIN of the angle is: 0.147811
(1 row(s) affected)
This example returns the arcsine of 1.00.
SELECT ASIN(1.00) AS asinCalc; This example returns an error, because it requests the arcsine for a value outside the allowed range.
SELECT ASIN(1.1472738) AS asinCalc; CEILING (Transact-SQL)
Mathematical Functions (Transact-SQL)
SET ARITHIGNORE (Transact-SQL)
SET ARITHABORT (Transact-SQL)