bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server CEILING() Function

Concept visual

SQL Server CEILING() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return the smallest integer value that is greater than or equal to a number:

SELECT CEILING(25.75) AS CeilValue;

Definition and Usage

The CEILING() function returns the smallest integer value that is larger than or equal to a number.

Tip:

Also look at the FLOOR()

and

Round()

functions.

Syntax

Ceiling(

number )

Parameter Values

Parameter

Description number

Required. A numeric value

Technical Details

Works in:

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

More Examples

Example

Return the smallest integer value that is greater than or equal to a number:

SELECT CEILING(25) AS CeilValue;

Example

Return the smallest integer value that is greater than or equal to a number:

SELECT CEILING(-13.5) AS CeilValue;

Previous

❮ SQL Server Functions

Next

Previous

SQL Server AVG() Function

Next

SQL Server COUNT() Function