In SQL Server, the T-SQL PI()
function is a mathematical function that returns the constant value of π (pi).
Tag: t-sql
COT() Examples in SQL Server
In SQL Server, the T-SQL COT()
function is a mathematical function that returns the trigonometric cotangent of the specified angle – in radians – in the specified float expression.
You specify the angle by providing an argument to the function when calling it.
COS() Examples in SQL Server
In SQL Server, the T-SQL COS()
function is a mathematical function that returns the trigonometric cosine of the specified angle – measured in radians – in the specified expression.
You specify the angle by providing an argument to the function when calling it.
FLOOR() Examples in SQL Server
In SQL Server, the T-SQL FLOOR()
function allows you to round a number down to the nearest integer. More specifically, it returns the largest integer less than or equal to the specified numeric expression.
You provide the number as an argument. The return data type is the same as the one provided as an argument.
CEILING() Examples in SQL Server
In SQL Server, the T-SQL CEILING()
function allows you to round a number up to the nearest integer. More specifically, it returns the smallest integer greater than, or equal to, the specified numeric expression.
You provide the number as an argument. The return data type is the same as the one provided as an argument.
ATN2() Examples in SQL Server
In SQL Server, the ATN2()
function returns the arctangent between two values. Specifically, it returns the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x), where x and y are the values of the two specified float expressions.
You provide the values as arguments when calling the function.
ATAN() Examples in SQL Server
In SQL Server, the ATAN()
function returns the arctangent of a value. In other words, it returns the angle, in radians, whose tangent is a specified float expression.
You provide the value as an argument when calling the function.
ASIN() Examples in SQL Server
Using SQL Server, you can use the T-SQL ASIN()
function to return the arcsine of a number. In other words, this function returns the angle, in radians, whose sine is the specified float expression.
The return data type is float.
You provide the number as an argument when calling the function.
How to Rename a JSON Key in SQL Server (T-SQL)
If you’ve been using the JSON_MODIFY()
function to modify JSON documents in SQL Server, you might be used to modifying the value part of a key/value property. But did you know that you can also modify the key part?
The trick to doing this is to copy the value to a new key, then delete the old key.
Examples below.
JSON_MODIFY() Examples in SQL Server (T-SQL)
In SQL Server, you can use the T-SQL JSON_MODIFY()
function to modify the value of a property in a JSON string. The function returns the updated JSON string.