SQL Server SIN() Function

The SIN() function in SQL Server calculates the trigonometric sine of a number (expressed in radians).



SIN(): Definition and Usage

This function is useful in applications requiring mathematical calculations, particularly in areas like geometry, physics, and engineering where trigonometric functions are essential.

Syntax

Syntax

SIN(number)
      

Parameter Values

Parameter Description
number The numeric value (in radians) for which you want to calculate the sine. This is required.

Examples

Calculating the Sine of a Positive Number

This example calculates the sine of the number 2 (radians).

Syntax

SELECT SIN(2);
      
Output

0.909297426825682  (The exact value may vary slightly depending on your SQL Server version)
      

Calculating the Sine of a Negative Number

This example demonstrates calculating the sine of a negative number (in radians).

Syntax

SELECT SIN(-1);
      
Output

-0.841470984807897 (The exact value may vary slightly depending on your SQL Server version)
      

Technical Details

The SIN() function is available in:

  • SQL Server (starting with version 2008)
  • Azure SQL Database
  • Azure SQL Data Warehouse
  • Parallel Data Warehouse