The SQL ASIN is one of the Mathematical Function which is used to calculate the trigonometry Arc sine for the specified expression. Arc sine is also called as inverse of a Sine, Please refer SQL SIN Function article to understand the Sine Function.

### SQL ASIN Function Syntax

In SQL Server, The basic syntax of the ASIN Function is:

1 2 |
SELECT ASIN (Float_Expression) FROM [Source] |

**TIP:** The ASIN function only accepts float values between -1 and 1.

In this article we will show you, How to write ASIN Function in SQL Server 2014 with example. For this, We are going to use the below shown data

## SQL ASIN Function Example 1

The SQL ASIN Function is used to calculate the Arcsine for given angle. The following query will show multiple ways to use ASIN function.

**T-SQL CODE**

1 2 3 4 5 6 7 8 9 10 |
DECLARE @i Float SET @i = -0.80 SELECT ASIN(@i)AS [Arc Sine] -- Calculating ASIN directly SELECT ASIN(0.27)AS [Arc Sine] -- Calculating ASIN directly SELECT ASIN(0.25 + 0.55 - 0.77)AS [Arc Sine] |

**OUTPUT**

**ANALYSIS**

Below lines of code is used to declare float variable and assigning the value.

1 2 |
DECLARE @i Float SET @i = -0.80 |

In the below statement, We used ASIN function to calculate the Arcsine value for the variable @i (It means ASIN(-0.80)). We also assigned new name to that result as ‘Arc Sine’ using SQL ALIAS Column.

1 |
SELECT ASIN(@i)AS [Arc Sine] |

In the next statements, We used the ASIN Function directly on the float values.

## SQL ASIN Function Example 2

In this example, We are going to calculate the Arcsine value for all the records present in [Service Grade] using ASIN Function.

**T-SQL CODE**

1 2 3 4 5 6 7 |
SELECT [EnglishProductName] ,[Color] ,[StandardCost] ,[SalesAmount] ,[Service Grade] AS Grade ,ASIN([Service Grade]) AS [Arc Sine] FROM [Mathemetical Functions] |

**OUTPUT**

Thank You for Visiting Our Blog

## Leave a Reply