MSDN – SQL Server Documentation

CEILING (Transact‑SQL)

Returns the smallest integer greater than, or equal to, the specified numeric expression.

Syntax

CEILING ( numeric_expression )

Parameters

ParameterDescription
numeric_expressionA valid numeric expression of type int, bigint, smallint, tinyint, decimal, numeric, float, or real. The expression can be a column, a variable, or any valid numeric expression.

Return Types

The return type is the same as the input type, except float and real always return float.

Remarks

Examples

Basic usage

SELECT CEILING(4.2)   AS Result1,
       CEILING(-4.2)         AS Result2,
       CEILING(5)            AS Result3;
-- Result1: 5
-- Result2: -4
-- Result3: 5

Interactive Demo

Enter a numeric value to see the CEILING result.

See Also