Ceiling Function In Sql Server
In this case 4 is the.
Ceiling function in sql server. Note that besides the ceil function sql also provides some function for rounding such as round and trunc functions which behave in a way similar to the ceil function. Depending on the data type integer float decimal etc the rounded value can be different. Return values have the same type as numeric expression.
The syntax of the sql server ceiling function is. In addition depending on the sql server rounding function round ceiling floor used in the calculation the values can differ as well. An expression of the exact numeric or approximate numeric data type category.
Sql server mathematical functions sqrt pi square round ceiling floor difference between structured query language sql and transact sql t sql degrees and radians function in sql server. Syntax of sql ceiling function. Let s look at some.
Select ceiling numeric expression from source for this ceiling function demo we are going to use the below shown data. It is an exact number or numeric data type expression. We use the sql ceiling function to evaluate the value and return the smallest integer greater than or equal to the specified numeric expression.
This ceiling function is used to return the closest integer value which is greater than or equal to the specified expression. The sql ceil function accepts a numeric expression and rounds up the argument to the nearest integer. See also the floor and round functions.
Example 1 positive values. Example 2 negative values. The ceiling function returns the smallest integer value that is larger than or equal to a.